oh-my-posh hangs when it should be computing the prompt #7013
Replies: 3 comments
-
|
@sba923 I looked at the traces and it turns out it's something oh-my-posh calls that's causing the deadlock. So it tries to get information and that request just hangs. What you can try is add |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @JanDeDobbeleer for looking into this. I'm adding Do you think of any other segment(s) in my configuration that might be a candidate for adding a timeout? |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Code of Conduct
What happened?
On my work laptop (Windows 10 Enterprise 10.0.19045.6575.amd64fre.vb_release.191206-1406), I'm experiencing the following with versions 27.5.2, 27.6.0 and 28.0.0: PowerShell (5.1 or 7.5.4, running in Windows Terminal Preview 1.24.2812.0) randomly (don't have a way to repro "at will") doesn't return to the prompt after running a command, because it's waiting for
oh-my-posh.exeto finish computing the prompt. I have toStop-Process -Name oh-my-poshfrom another window to regain control.Full process dumps are available but I can't upload them here.
Theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"console_title_template": "{{ .Folder }}",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"style": "diamond",
"leading_diamond": "\ue0b6",
"foreground": "#2b2b2b",
"background": "#86e2f1",
"type": "session"
},
{
"properties": {
"style": "folder"
},
"style": "powerline",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"background": "#ff8c00",
"type": "path"
},
{
"properties": {
"mapped_shell_names": {
"pwsh": "PS"
}
},
"style": "powerline",
"template": "{{ if ne .Shell "pwsh" }} {{ .Name }} {{ end }}",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"background": "#0077c2",
"type": "shell"
},
{
"style": "powerline",
"template": "{{ if .WSL }} {{ "WSL" }} {{ end }}",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"background": "#cf9e11",
"type": "text"
},
{
"type": "text",
"style": "powerline",
"powerline_symbol": "\ue0b0",
"foreground": "#ffffff",
"background": "#0078d7",
"template": "{{ if and (eq .Shell "pwsh") (not (contains "7.5.4" .ShellVersion)) (not (contains "7.6.0-preview" .ShellVersion)) }}{{ .ShellVersion }}{{ end }}"
},
{
"properties": {
"branch_max_length": 25,
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true
},
"style": "powerline",
"trailing_diamond": "\ue0b4",
"template": " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uf692 {{ .StashCount }}{{ end }} ",
"foreground": "#193549",
"powerline_symbol": "\ue0b0",
"background": "#fffb38",
"type": "git",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}",
"{{ if gt .Ahead 0 }}#B388FF{{ end }}",
"{{ if gt .Behind 0 }}#B388FF{{ end }}"
]
},
{
"properties": {
"fetch_version": true
},
"style": "powerline",
"template": " \uf898 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"background": "#6CA35E",
"type": "node"
},
{
"properties": {
"fetch_version": true
},
"style": "powerline",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"background": "#6CA35E",
"type": "dotnet"
},
{
"properties": {
"display_default": false
},
"style": "powerline",
"template": " \ue7ad {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} ",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"background": "#ff2222",
"type": "aws",
"background_templates": [
"{{if contains "default" .Profile}}#FFA400{{end}}",
"{{if contains "jan" .Profile}}#f1184c{{end}}"
]
},
{
"style": "powerline",
"foreground": "#ffff66",
"powerline_symbol": "\ue0b0",
"background": "#ff0000",
"type": "root"
},
{
"properties": {
"always_enabled": true
},
"style": "powerline",
"template": "\u231b{{ .FormattedMs }}\u2800",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"background": "#83769c",
"type": "executiontime"
},
{
"properties": {
"always_enabled": true,
"status_separator": " ",
"status_template": "{{ if ne .Code 0 }}\uf071 ({{ if or (gt .Code 255) (lt .Code 0) }}{{ .Code | hresult }}{{ else }}{{.Code}}{{ end }}){{ else }}\uf00c{{ end }}"
},
"style": "diamond",
"trailing_diamond": "\ue0b4",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"background": "#2e9599",
"type": "status",
"background_templates": [
"{{ if (ne .Code 0) }}#f1184c{{ end }}"
]
}
]
},
{
"type": "rprompt",
"alignment": "right",
"segments": [
{
"properties": {
"charged_icon": "\ue22f ",
"charging_icon": "\ue234 ",
"discharging_icon": "\ue231 "
},
"style": "diamond",
"leading_diamond": "\ue0b6",
"template": " {{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}\uf295 ",
"foreground": "#ffffff",
"background": "#f36943",
"type": "battery",
"background_templates": [
"{{if eq "Charging" .State.String}}#40c4ff{{end}}",
"{{if eq "Discharging" .State.String}}#ff5722{{end}}",
"{{if eq "Full" .State.String}}#4caf50{{end}}"
]
},
{
"style": "plain",
"template": "<background,parentBackground>{{ if .Segments.Contains "Battery" }}\ue0b2{{ else }}\ue0b6{{ end }}</> {{ .CurrentDate | date .Format }} <background,transparent>\ue0b4</>",
"foreground": "#111111",
"powerline_symbol": "\ue0b0",
"background": "#2e9599",
"type": "time"
}
]
}
],
"version": 3,
"auto_upgrade": true,
"shell_integration": true,
"final_space": true
}
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output
Beta Was this translation helpful? Give feedback.
All reactions