Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird Crash when using in combination with nvs #2568

Closed
1 task done
possum-enjoyer opened this issue Jul 25, 2022 · 7 comments
Closed
1 task done

Weird Crash when using in combination with nvs #2568

possum-enjoyer opened this issue Jul 25, 2022 · 7 comments
Assignees
Labels
🐛 bug Something isn't working 🏝 external The issue isn't with oh-my-posh

Comments

@possum-enjoyer
Copy link

Code of Conduct

  • I agree to follow this project's Code of Conduct

What happened?

I stumbled around a weird bug or crash where the whole theme in the console crashes when i try to use the nvs auto feature (nvs auto on). This only happens since version 7.72.4 (I narrowed it down) but i am unable to say if this the fix was the reason for this bug or if nvs is the "culprit".

Here an example to see that it's working on 7.72.3:

image

And here an example that it's not working on 7.72.4:

image

Theme

{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#c386f1",
"foreground": "#ffffff",
"leading_diamond": "\ue0b6",
"style": "diamond",
"template": " {{ .UserName }} ",
"trailing_diamond": "\ue0b0",
"type": "session"
},
{
"background": "#ff479c",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"properties": {
"folder_separator_icon": " \ue0b1 ",
"home_icon": "~",
"style": "folder"
},
"style": "powerline",
"template": " \uf74a {{ .Path }} ",
"type": "path"
},
{
"background": "#fffb38",
"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 }}"
],
"foreground": "#193549",
"leading_diamond": "\ue0b6",
"powerline_symbol": "\ue0b0",
"properties": {
"branch_max_length": 25,
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true
},
"style": "powerline",
"template": " {{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ 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 }} ",
"trailing_diamond": "\ue0b4",
"type": "git"
},
{
"background": "#6CA35E",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"properties": {
"fetch_version": true
},
"style": "powerline",
"template": " \uf898 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ",
"type": "node"
},
{
"background": "#8ED1F7",
"foreground": "#111111",
"powerline_symbol": "\ue0b0",
"properties": {
"fetch_version": true
},
"style": "powerline",
"template": " \ue626 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ",
"type": "go"
},
{
"background": "#4063D8",
"foreground": "#111111",
"powerline_symbol": "\ue0b0",
"properties": {
"fetch_version": true
},
"style": "powerline",
"template": " \ue624 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ",
"type": "julia"
},
{
"background": "#FFDE57",
"foreground": "#111111",
"powerline_symbol": "\ue0b0",
"properties": {
"display_mode": "files",
"fetch_virtual_env": false
},
"style": "powerline",
"template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ",
"type": "python"
},
{
"background": "#AE1401",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"properties": {
"display_mode": "files",
"fetch_version": true
},
"style": "powerline",
"template": " \ue791 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ",
"type": "ruby"
},
{
"background": "#FEAC19",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"properties": {
"display_mode": "files",
"fetch_version": false
},
"style": "powerline",
"template": " \uf0e7{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ",
"type": "azfunc"
},
{
"background_templates": [
"{{if contains "default" .Profile}}#FFA400{{end}}",
"{{if contains "jan" .Profile}}#f1184c{{end}}"
],
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"properties": {
"display_default": false
},
"style": "powerline",
"template": " \ue7ad {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} ",
"type": "aws"
},
{
"background": "#ffff66",
"foreground": "#111111",
"powerline_symbol": "\ue0b0",
"style": "powerline",
"template": " \uf0ad ",
"type": "root"
},
{
"background": "#83769c",
"foreground": "#ffffff",
"properties": {
"always_enabled": true
},
"style": "plain",
"template": "\ue0b0</> \ufbab{{ .FormattedMs }}\u2800",
"type": "executiontime"
},
{
"background": "#00897b",
"background_templates": [
"{{ if gt .Code 0 }}#e91e63{{ end }}"
],
"foreground": "#ffffff",
"properties": {
"always_enabled": true
},
"style": "diamond",
"template": "\ue0b0</> \ue23a ",
"trailing_diamond": "\ue0b4",
"type": "exit"
}
],
"type": "prompt"
},
{
"segments": [
{
"background": "#0077c2",
"foreground": "#ffffff",
"style": "plain",
"template": "<#0077c2,transparent>\ue0b6</> \uf489 {{ .Name }} <transparent,#0077c2>\ue0b2</>",
"type": "shell"
},
{
"background": "#1BD760",
"foreground": "#111111",
"invert_powerline": true,
"powerline_symbol": "\ue0b2",
"properties": {
"paused_icon": "\uf04c ",
"playing_icon": "\uf04b "
},
"style": "powerline",
"template": " \uf167 {{ .Icon }}{{ if ne .Status "stopped" }}{{ .Artist }} - {{ .Track }}{{ end }} ",
"type": "ytm"
},
{
"background": "#f36943",
"background_templates": [
"{{if eq "Charging" .State.String}}#40c4ff{{end}}",
"{{if eq "Discharging" .State.String}}#ff5722{{end}}",
"{{if eq "Full" .State.String}}#4caf50{{end}}"
],
"foreground": "#ffffff",
"invert_powerline": true,
"powerline_symbol": "\ue0b2",
"properties": {
"charged_icon": "\ue22f ",
"charging_icon": "\ue234 ",
"discharging_icon": "\ue231 "
},
"style": "powerline",
"template": " {{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}\uf295 ",
"type": "battery"
},
{
"background": "#2e9599",
"foreground": "#111111",
"invert_powerline": true,
"leading_diamond": "\ue0b2",
"style": "diamond",
"template": " {{ .CurrentDate | date .Format }} ",
"trailing_diamond": "\ue0b4",
"type": "time"
}
],
"type": "rprompt"
}
],
"console_title_template": "{{ .Shell }} in {{ .Folder }}",
"final_space": true,
"version": 2
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

�[1mVersion:�[0m 7.72.4

�[1mSegments:�[0m

ConsoleTitle(true)   -   0 ms - oh-my-posh in ~
session(true)        -   0 ms - �[38;2;195;134;241m╬╡├⌐Γòó�[0m�[48;2;195;134;241m�[38;2;255;255;255m redacted �[0m�[38;2;195;134;241m╬╡├⌐Γûæ�[0m
path(true)           -   0 ms - �[38;2;255;71;156;49m�[7m╬╡├⌐Γûæ�[0m�[48;2;255;71;156m�[38;2;255;255;255m Γê⌐┬Ñ├¿  ~ �[0m
git(false)           -   1 ms - 
node(false)          -   0 ms - 
go(false)            -   0 ms - 
julia(false)         -   0 ms - 
python(false)        -   0 ms - 
ruby(false)          -   0 ms - 
azfunc(false)        -   0 ms - 
aws(false)           -   0 ms - 
root(false)          -   0 ms - 
executiontime(true)  -   0 ms - �[38;2;255;71;156m╬╡├⌐Γûæ�[0m�[38;2;131;118;156;49m�[7m╬╡├⌐Γûæ�[0m�[48;2;131;118;156m�[38;2;255;255;255m Γê⌐┬½┬╜0ms╬ô├í├ç�[0m
exit(true)           -   2 ms - �[48;2;0;137;123m�[38;2;131;118;156m╬╡├⌐Γûæ�[0m�[48;2;0;137;123m�[38;2;255;255;255m ╬╡├¬Γòæ �[0m�[38;2;0;137;123m╬╡├⌐Γöñ�[0m
shell(true)          -   0 ms - �[38;2;0;119;194m╬╡├⌐Γòó�[0m�[48;2;0;119;194m�[38;2;255;255;255m Γê⌐├å├½ oh-my-posh �[0m�[38;2;0;119;194;49m�[7m╬╡├⌐Γûô�[0m
ytm(false)           -  35 ms - 
battery(true)        -  14 ms - �[38;2;76;175;80m╬╡├⌐Γûô�[0m�[48;2;76;175;80m�[38;2;255;255;255m ╬╡├¬┬╗ 100Γê⌐├¿├▓ �[0m
time(true)           -   0 ms - �[38;2;76;175;80;49m�[7m╬╡├⌐Γûô�[0m�[38;2;46;149;153m╬╡├⌐Γûô�[0m�[48;2;46;149;153m�[38;2;17;17;17m 21:51:12 �[0m�[38;2;46;149;153m╬╡├⌐Γöñ�[0m

�[1mRun duration:�[0m 55.3183ms

�[1mCache path:�[0m C:\Users\redacted\AppData\Local\oh-my-posh

�[1mLogs:�[0m

2022/07/25 21:51:12 Flags duration: 0s, args: 
2022/07/25 21:51:12 Flags duration: 0s, args: 
2022/07/25 21:51:12 debug: Getenv

2022/07/25 21:51:12 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/07/25 21:51:12 Root duration: 0s, args: 
2022/07/25 21:51:12 Shell duration: 0s, args: 
2022/07/25 21:51:12 ErrorCode duration: 0s, args: 
2022/07/25 21:51:12 IsWsl duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 PathSeparator duration: 0s, args: 
2022/07/25 21:51:12 PathSeparator duration: 0s, args: 
2022/07/25 21:51:12 debug: User
redacted
2022/07/25 21:51:12 User duration: 0s, args: 
2022/07/25 21:51:12 debug: Host
DELL20220607
2022/07/25 21:51:12 Host duration: 0s, args: 
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 debug: Getenv

2022/07/25 21:51:12 Getenv duration: 0s, args: SSH_CONNECTION
2022/07/25 21:51:12 debug: Getenv

2022/07/25 21:51:12 Getenv duration: 0s, args: SSH_CLIENT
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 Flags duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 PathSeparator duration: 0s, args: 
2022/07/25 21:51:12 PathSeparator duration: 0s, args: 
2022/07/25 21:51:12 PathSeparator duration: 0s, args: 
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 IsWsl duration: 0s, args: 
2022/07/25 21:51:12 StackCount duration: 0s, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 HasCommand duration: 1.5978ms, args: git.exe
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 error: HasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/07/25 21:51:12 HasParentFilePath duration: 0s, args: .git
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 PathSeparator duration: 0s, args: 
2022/07/25 21:51:12 debug: HasFiles
false
2022/07/25 21:51:12 HasFiles duration: 0s, args: *.py
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 PathSeparator duration: 0s, args: 
2022/07/25 21:51:12 debug: HasFiles
false
2022/07/25 21:51:12 HasFiles duration: 0s, args: *.ipynb
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 PathSeparator duration: 0s, args: 
2022/07/25 21:51:12 debug: HasFiles
false
2022/07/25 21:51:12 HasFiles duration: 0s, args: pyproject.toml
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 PathSeparator duration: 0s, args: 
2022/07/25 21:51:12 debug: HasFiles
false
2022/07/25 21:51:12 HasFiles duration: 0s, args: venv.bak
2022/07/25 21:51:12 debug: HasFolder
false
2022/07/25 21:51:12 HasFolder duration: 0s, args: .venv
2022/07/25 21:51:12 debug: HasFolder
false
2022/07/25 21:51:12 HasFolder duration: 0s, args: venv
2022/07/25 21:51:12 debug: HasFolder
false
2022/07/25 21:51:12 HasFolder duration: 0s, args: virtualenv
2022/07/25 21:51:12 debug: HasFolder
false
2022/07/25 21:51:12 HasFolder duration: 0s, args: env
2022/07/25 21:51:12 debug: HasFolder
false
2022/07/25 21:51:12 HasFolder duration: 0s, args: venv-win
2022/07/25 21:51:12 debug: HasFolder
false
2022/07/25 21:51:12 HasFolder duration: 0s, args: pyenv-win
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 debug: Getenv

2022/07/25 21:51:12 Getenv duration: 0s, args: AWS_VAULT
2022/07/25 21:51:12 debug: Getenv

2022/07/25 21:51:12 Getenv duration: 0s, args: AWS_PROFILE
2022/07/25 21:51:12 debug: Getenv

2022/07/25 21:51:12 Getenv duration: 0s, args: AWS_REGION
2022/07/25 21:51:12 debug: Getenv

2022/07/25 21:51:12 Getenv duration: 0s, args: AWS_DEFAULT_REGION
2022/07/25 21:51:12 debug: Getenv

2022/07/25 21:51:12 Getenv duration: 0s, args: AWS_CONFIG_FILE
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 error: FileContent
open C:\Users\redacted/.aws/config: The system cannot find the path specified.
2022/07/25 21:51:12 FileContent duration: 0s, args: C:\Users\redacted/.aws/config
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 Root duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 ExecutionTime duration: 0s, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 ErrorCode duration: 0s, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 Shell duration: 0s, args: 
2022/07/25 21:51:12 Flags duration: 0s, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 error: HTTPRequest
Get "http://127.0.0.1:9863/query": context deadline exceeded
2022/07/25 21:51:12 HTTPRequest duration: 35.7424ms, args: http://127.0.0.1:9863/query
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 IsWsl duration: 0s, args: 
2022/07/25 21:51:12 BatteryInfo duration: 13.4348ms, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 debug: Pwd
C:\Users\redacted
2022/07/25 21:51:12 Pwd duration: 0s, args: 
2022/07/25 21:51:12 debug: Home
C:\Users\redacted
2022/07/25 21:51:12 GOOS duration: 0s, args: 
2022/07/25 21:51:12 TemplateCache duration: 0s, args: 
2022/07/25 21:51:12 debug: Getenv
C:\Users\redacted\AppData\Local
2022/07/25 21:51:12 Getenv duration: 0s, args: LOCALAPPDATA
2022/07/25 21:51:12 CachePath duration: 0s, args:
@possum-enjoyer possum-enjoyer added the 🐛 bug Something isn't working label Jul 25, 2022
@JanDeDobbeleer
Copy link
Owner

@possum-enjoyer after the crashing prompt, can you show the output of $error?

@possum-enjoyer
Copy link
Author

Sure can do:

�[32;1mErrorRecord : �[0mThe term 'Get-PoshContext' is not recognized as a name of a cmdlet, function, script file, or executable program.
�[32;1m �[0mCheck the spelling of the name, or if a path was included, verify that the path is correct and try again.
�[32;1mWasThrownFromThrowStatement : �[0mFalse
�[32;1mTargetSite : �[0mSystem.Collections.ObjectModel.Collection1[System.Management.Automation.PSObject] Invoke(System.Collections.IEnumerable) �[32;1mMessage : �[0mThe term 'Get-PoshContext' is not recognized as a name of a cmdlet, function, script file, or executable program. �[32;1m �[0mCheck the spelling of the name, or if a path was included, verify that the path is correct and try again. �[32;1mData : �[0m{System.Management.Automation.Interpreter.InterpretedFrameInfo} �[32;1mInnerException : �[0mSystem.Management.Automation.CommandNotFoundException: The term 'Get-PoshContext' is not recognized as a name of a cmdlet, function, script file, or executable program. �[32;1m �[0mCheck the spelling of the name, or if a path was included, verify that the path is correct and try again. �[32;1m �[0m at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) �[32;1m �[0m at System.Management.Automation.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame)
�[32;1m �[0m at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
�[32;1m �[0m at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
�[32;1m �[0m at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
�[32;1m �[0m at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
�[32;1m �[0m at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary2 functionsToDefine, List1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
�[32;1m �[0m at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsToTop, List1 variablesToDefine, Dictionary2 functionsToDefine, Object[] args)
�[32;1m �[0m at System.Management.Automation.ScriptBlock.InvokeUsingCmdlet(Cmdlet contextCmdlet, Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Object[] args)
�[32;1m �[0m at Microsoft.PowerShell.Commands.InvokeExpressionCommand.ProcessRecord()
�[32;1m �[0m at System.Management.Automation.Cmdlet.DoProcessRecord()
�[32;1m �[0m at System.Management.Automation.CommandProcessor.ProcessRecord()
�[32;1mHelpLink : �[0m
�[32;1mSource : �[0mSystem.Management.Automation
�[32;1mHResult : �[0m-2146233087
�[32;1mStackTrace : �[0m at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
�[32;1m �[0m at System.Management.Automation.Runspaces.Pipeline.Invoke()
�[32;1m �[0m at Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception& exceptionThrown, ExecutionOptions options)

�[91mGet-PoshContext:
�[96mLine |
�[96m 6 | �[0m $cleanPWD, $cleanPSWD = �[96mGet-PoshContext�[0m
�[96m | �[91m ~~~~~~~~~~~~~~~
�[91m�[96m | �[91mThe term 'Get-PoshContext' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.�[0m

@lewis-yeung
Copy link
Contributor

lewis-yeung commented Jul 26, 2022

I think I have found the culprit. There is some logic of NVS causing OMP's Get-PoshContext function to be not recognized. The NVS-defined dynamic module exports a prompt function, which overrides the OMP-defined one, thus it cannot find Get-PoshContext defined in OMP's dynamic module. This didn't happen until v7.72.4 because we introduced the dynamic module initialization in this version.

EDITED: Not only Get-PoshContext but all functions defined in OMP's dynamic module will be isolated due to this logic. I think NVS has a responsibility to resolve this because it's not a tool of prompt customization and it should respect the user's custom prompt function. I know how to fix it and I'd like to submit a PR to the NVS repo.

@JanDeDobbeleer
Copy link
Owner

@lewis-yeung agreed, it shouldn't touch the prompt function as it will for sure introduce other side effects too. I'll close this one and let's get that merged on their end 👍🏻

@thomazmoura
Copy link

Hey guys, is there any setting that should be used for this to work?

I see both PR's got merged but I'm currently facing issues with oh-my-posh and nvs auto together - activating one simply disables the other. If I have oh-my-posh enabled nvs doesn't change node version automatically when I move to a folder with a .node-version. If I run nvs auto on then oh-my-posh disappears and the auto switching works again.

I wouldn't mind nvs being silent if it meant it would still change the node version automatically, but to not be able to switch automatically when using oh-my-posh really breaks my flow.

I'm currently using version 18.9.1 of oh-my-posh and version 1.7.0 of nvs.

@JanDeDobbeleer
Copy link
Owner

@thomazmoura no idea tbh, I don't use this. But, as NVS' initial issue is that hey hijack the prompt, it could as well easily be once again introduced by them.

Copy link

github-actions bot commented Apr 1, 2024

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working 🏝 external The issue isn't with oh-my-posh
Projects
None yet
Development

No branches or pull requests

4 participants