JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.38k stars 2.39k forks source link

panic: runtime error: invalid memory address or nil pointer dereference #2243

Closed kamack38 closed 2 years ago

kamack38 commented 2 years ago

Code of Conduct

What happened?

When running in bash I get an error:

panic: runtime error: invalid memory address or nil pointer dereference
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x81 pc=0x77a701]

goroutine 1 [running]:
oh-my-posh/environment.(*ShellEnvironment).Trace(0x7f2e914635b8?, {0x10?, 0x1580ca0?, 0x15805c0?}, {0xb4fb9d?, 0x8?}, {0x0?, 0xc000157bd7?, 0x1?})
    /home/runner/work/oh-my-posh/oh-my-posh/src/environment/shell.go:300 +0x41
panic({0xab5e00, 0x1569100})
    /opt/hostedtoolcache/go/1.18.1/x64/src/runtime/panic.go:838 +0x207
oh-my-posh/environment.(*ShellEnvironment).Init(0xc000137260)
    /home/runner/work/oh-my-posh/oh-my-posh/src/environment/shell.go:232 +0x7c
oh-my-posh/cli.glob..func7(0x1574f80?, {0xc0002138f0, 0x1?, 0x1?})
    /home/runner/work/oh-my-posh/oh-my-posh/src/cli/get.go:34 +0x9b
github.com/spf13/cobra.(*Command).execute(0x1574f80, {0xc0002138c0, 0x1, 0x1})
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x1573b80)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
oh-my-posh/cli.Execute({0xc6e1f0?, 0xc0000021a0?})
    /home/runner/work/oh-my-posh/oh-my-posh/src/cli/root.go:40 +0x4a
main.main()
    /home/runner/work/oh-my-posh/oh-my-posh/src/main.go:10 +0x27

But when I run oh-my-posh in fish, I get no error

Theme

{ "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", "blocks": [ { "alignment": "left", "newline": true, "segments": [ { "background": "#18354F", "foreground": "#d2ff5e", "leading_diamond": "\ue0b6", "properties": { "alpine": "<#0D597F>\uf300</>", "arch": "<#1793d1>\uf303</>", "centos": "\uf304", "debian": "<#A90232>\uf306</>", "elementary": "<#44A2E8>\uf309</>", "fedora": "<#072B61>\uf30a</>", "gentoo": "<#61538D>\uf30d</>", "linux": "<#F5C11B>\ue712</>", "macos": "\ue711", "manjaro": "<#34BE5B>\uf312</>", "mint": "<#86BE43>\uf30f</>", "opensuse": "<73BA25>\uf314</>", "raspbian": "<#C51A4A>\uf315</>", "ubuntu": "<#E95420>\uf31c</>", "windows": "<#26C6DA>\ue70f</>" }, "template": " {{ if .WSL }}<#26C6DA>\ue70f</>/{{ end }}{{.Icon}} ", "style": "diamond", "type": "os" }, { "background": "#2e6f95", "foreground": "#38DE21", "powerline_symbol": "\ue0b0", "properties": { "home_icon": "\uf7db", "mapped_locations": { "~\.config": "\ue615", "~\Desktop": "\uf6c3", "~\Documents": "\uf718", "~\Documents\CPlusPlus": "\ue61d", "~\Documents\GitHUB": "\uf408", "~\Downloads": "\uf019", "~\Music": "\ufc58", "~\Pictures": "\uf7ea", "~\Videos": "\uf03d" }, "style": "full" }, "style": "powerline", "type": "path" }, { "background": "#4ecdc4", "background_templates": [ "{{ if or (.Working.Changed) (.Staging.Changed) }}#EDC809{{ end }}", "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#F26D50{{ end }}", "{{ if gt .Ahead 0 }}#B56576{{ end }}", "{{ if gt .Behind 0 }}#6D597A{{ end }}" ], "foreground": "#f7fff7", "powerline_symbol": "\ue0b0", "properties": { "branch_icon": "\uf126 ", "fetch_stash_count": true, "fetch_status": true, "fetch_upstream_icon": true }, "style": "powerline", "type": "git" } ], "type": "prompt" }, { "alignment": "right", "segments": [ { "background": "#ffff66", "foreground": "#111111", "invert_powerline": true, "powerline_symbol": "\ue0b2", "style": "powerline", "type": "root" }, { "background": "#689f63", "foreground": "#ffffff", "invert_powerline": true, "powerline_symbol": "\ue0b2", "properties": { "fetch_package_manager": true }, "style": "powerline", "type": "node" }, { "background": "#2bb1ee", "foreground": "#03589c", "powerline_symbol": "\ue0b2", "style": "powerline", "type": "dart" }, { "background": "#4063D8", "foreground": "#ffffff", "powerline_symbol": "\ue0b2", "style": "powerline", "type": "php" }, { "background": "lightWhite", "foreground": "blue", "powerline_symbol": "\ue0b2", "style": "powerline", "type": "r" }, { "background": "#c3002f", "foreground": "#ffffff", "powerline_symbol": "\ue0b2", "style": "powerline", "type": "angular" }, { "background": "#00acd7", "foreground": "#111111", "invert_powerline": true, "powerline_symbol": "\ue0b2", "properties": { "fetch_version": true }, "style": "powerline", "type": "go" }, { "background": "#4063D8", "foreground": "#111111", "invert_powerline": true, "powerline_symbol": "\ue0b2", "properties": { "fetch_version": true }, "style": "powerline", "type": "julia" }, { "background": "#ebcc34", "foreground": "#000000", "powerline_symbol": "\ue0b0", "style": "powerline", "type": "kubectl" }, { "background": "#FFDE57", "foreground": "#4584B6", "invert_powerline": true, "powerline_symbol": "\ue0b2", "properties": { "display_mode": "files", "fetch_version": true, "fetch_virtual_env": false }, "style": "powerline", "type": "python" }, { "background": "#906cff", "foreground": "#ffffff", "invert_powerline": true, "powerline_symbol": "\ue0b2", "style": "powerline", "type": "kotlin" }, { "background": "#4063D8", "foreground": "#ffffff", "invert_powerline": true, "powerline_symbol": "\ue0b2", "style": "powerline", "type": "crystal" }, { "background": "#AE1401", "foreground": "#ffffff", "invert_powerline": true, "powerline_symbol": "\ue0b2", "properties": { "display_mode": "files", "fetch_version": true }, "style": "powerline", "type": "ruby" }, { "background": "#29315A", "foreground": "#E64747", "invert_powerline": true, "powerline_symbol": "\ue0b2", "properties": { "fetch_version": true }, "style": "powerline", "type": "java" }, { "background": "#4E2BCD", "foreground": "#ffffff", "powerline_symbol": "\ue0b2", "properties": { "fetch_version": true }, "style": "powerline", "type": "dotnet" }, { "background": "#99908a", "foreground": "#193549", "powerline_symbol": "\ue0b2", "properties": { "fetch_version": true }, "style": "powerline", "type": "rust" }, { "background": "#FEAC19", "foreground": "#ffffff", "invert_powerline": true, "powerline_symbol": "\ue0b2", "properties": { "display_mode": "files", "fetch_version": false }, "style": "powerline", "type": "azfunc" }, { "background_templates": ["{{if contains \"default\" .Profile}}#FFA400{{end}}", "{{if contains \"jan\" .Profile}}#f1184c{{end}}"], "foreground": "#ffffff", "invert_powerline": true, "powerline_symbol": "\ue0b2", "properties": { "display_default": false }, "style": "powerline", "type": "aws" }, { "background": "#5c41e2", "foreground": "#fefefe", "powerline_symbol": "\ue0b2", "style": "powerline", "type": "terraform" }, { "background": "#0077C2", "foreground": "#FFFFFF", "invert_powerline": true, "powerline_symbol": "\ue0b2", "style": "powerline", "type": "shell" }, { "background": "#ffe66d", "foreground": "#293241", "invert_powerline": true, "powerline_symbol": "\ue0b2", "properties": { "style": "austin" }, "style": "powerline", "type": "executiontime" }, { "background": "#3BD01D", "background_templates": ["{{ if gt .Code 0 }}#FF005D{{ end }}"], "foreground": "#d3d7cf", "invert_powerline": true, "powerline_symbol": "\ue0b0", "template": " {{ if gt .Code 0 }}\uf00d{{ else }}\uf42e{{ end }} ", "properties": { "always_enabled": true }, "style": "diamond", "type": "exit" } ], "type": "prompt" }, { "alignment": "left", "newline": true, "segments": [ { "foreground": "#3BD01D", "style": "plain", "template": "\u276f", "type": "text" } ], "type": "prompt" }, { "alignment": "right", "segments": [ { "background": "#1BD760", "foreground": "#ffffff", "leading_diamond": "\ue0b6", "properties": { "track_separator": " - " }, "style": "diamond", "trailing_diamond": "\ue0b4", "type": "spotify" } ], "type": "rprompt" } ], "console_title_template": "{{if .Root}}\u26a1 {{end}}{{ .Shell }} in {{ .Folder }}", "final_space": true, "osc99": true, "tooltips": [ { "background": "#689f63", "foreground": "#ffffff", "leading_diamond": "\ue0b6", "properties": { "display_mode": "always", "fetch_package_manager": true, "fetch_version": true, "home_enabled": true }, "style": "diamond", "tips": ["node", "n", "npm"], "trailing_diamond": "\ue0b4", "type": "node" }, { "background": "#29315A", "foreground": "#E64747", "leading_diamond": "\ue0b6", "properties": { "display_mode": "always", "fetch_version": true, "home_enabled": true }, "style": "diamond", "tips": ["java", "jar"], "trailing_diamond": "\ue0b4", "type": "java" } ], "transient_prompt": { "background": "transparent", "foreground": "#ffffff", "template": "<#5555ff>{{ .Folder }}</> <#3BD01D>\u276f</> " }, "version": 2 }

What OS are you seeing the problem on?

Linux

Which shell are you using?

bash

Log output

panic: runtime error: invalid memory address or nil pointer dereference
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x81 pc=0x77a701]

goroutine 1 [running]:
oh-my-posh/environment.(*ShellEnvironment).Trace(0x7f998b97a5b8?, {0x10?, 0x1580ca0?, 0x15805c0?}, {0xb4fb9d?, 0x8?}, {0x0?, 0xc000157bd7?, 0x1?})
    /home/runner/work/oh-my-posh/oh-my-posh/src/environment/shell.go:300 +0x41
panic({0xab5e00, 0x1569100})
    /opt/hostedtoolcache/go/1.18.1/x64/src/runtime/panic.go:838 +0x207
oh-my-posh/environment.(*ShellEnvironment).Init(0xc000137260)
    /home/runner/work/oh-my-posh/oh-my-posh/src/environment/shell.go:232 +0x7c
oh-my-posh/cli.glob..func7(0x1574f80?, {0xc0002138f0, 0x1?, 0x1?})
    /home/runner/work/oh-my-posh/oh-my-posh/src/cli/get.go:34 +0x9b
github.com/spf13/cobra.(*Command).execute(0x1574f80, {0xc0002138c0, 0x1, 0x1})
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x1573b80)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
oh-my-posh/cli.Execute({0xc6e1f0?, 0xc0000021a0?})
    /home/runner/work/oh-my-posh/oh-my-posh/src/cli/root.go:40 +0x4a
main.main()
    /home/runner/work/oh-my-posh/oh-my-posh/src/main.go:10 +0x27

Version: 7.79.3

Segments:

ConsoleTitle(true)   -  28 ms - bash in ~
os(true)             -   0 ms -  
path(true)           -   0 ms -  
git(false)           -   0 ms -
root(false)          -   0 ms -
node(false)          -   0 ms -
dart(false)          -   0 ms -
php(false)           -   0 ms -
r(false)             -   0 ms -
angular(false)       -   0 ms -
go(false)            -   0 ms -
julia(false)         -   0 ms -
kubectl(false)       -   0 ms -
python(false)        -   0 ms -
kotlin(false)        -   0 ms -
crystal(false)       -   0 ms -
ruby(false)          -   0 ms -
java(false)          -   0 ms -
dotnet(false)        -   0 ms -
rust(false)          -   0 ms -
azfunc(false)        -   0 ms -
aws(false)           -   0 ms -
terraform(false)     -   0 ms -
shell(true)          -   0 ms -  bash
executiontime(false) -   0 ms -
exit(true)           -   0 ms -  
text(true)           -   1 ms - ❯
spotify(false)       -   0 ms -

Run duration: 33.297185ms

Cache path: /home/kamack38/.cache/oh-my-posh

Config path: /home/kamack38/.config/oh-my-posh/kamack.omp.json

Logs:

2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 10.476µs, args: XDG_CACHE_HOME
2022/05/08 18:02:08 CachePath duration: 32.896µs, args:
2022/05/08 18:02:08 debug: Getenv
/home/kamack38/.config/oh-my-posh/kamack.omp.json
2022/05/08 18:02:08 Getenv duration: 6.216µs, args: POSH_THEME
2022/05/08 18:02:08 resolveConfigPath duration: 13.27µs, args:
2022/05/08 18:02:08 Init duration: 99.593µs, args:
2022/05/08 18:02:08 Flags duration: 977ns, args:
2022/05/08 18:02:08 config.loadConfig duration: 806.037µs, args:
2022/05/08 18:02:08 Flags duration: 978ns, args:
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 3.771µs, args: OMP_CACHE_DISABLED
2022/05/08 18:02:08 Root duration: 1.397µs, args:
2022/05/08 18:02:08 Shell duration: 27.946026ms, args:
2022/05/08 18:02:08 ErrorCode duration: 978ns, args:
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 3.701µs, args: WSL_DISTRO_NAME
2022/05/08 18:02:08 IsWsl duration: 12.222µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 22.279µs, args:
2022/05/08 18:02:08 PathSeparator duration: 908ns, args:
2022/05/08 18:02:08 PathSeparator duration: 908ns, args:
2022/05/08 18:02:08 debug: User
kamack38
2022/05/08 18:02:08 User duration: 3.841µs, args:
2022/05/08 18:02:08 debug: Host
kamack38-rogstrixg533qs
2022/05/08 18:02:08 Host duration: 4.749µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 TemplateCache duration: 28.087314ms, args:
2022/05/08 18:02:08 Flags duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.282µs, args:
2022/05/08 18:02:08 GOOS duration: 977ns, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 TemplateCache duration: 978ns, args:
2022/05/08 18:02:08 TemplateCache duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 8.73µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.863µs, args:
2022/05/08 18:02:08 Flags duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.422µs, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 GOOS duration: 1.397µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 GOOS duration: 977ns, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 GOOS duration: 1.397µs, args:
2022/05/08 18:02:08 GOOS duration: 977ns, args:
2022/05/08 18:02:08 GOOS duration: 2.375µs, args:
2022/05/08 18:02:08 PathSeparator duration: 978ns, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 2.863µs, args: WSL_DISTRO_NAME
2022/05/08 18:02:08 IsWsl duration: 8.94µs, args:
2022/05/08 18:02:08 StackCount duration: 978ns, args:
2022/05/08 18:02:08 TemplateCache duration: 908ns, args:
2022/05/08 18:02:08 TemplateCache duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.794µs, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 2.933µs, args: WSL_DISTRO_NAME
2022/05/08 18:02:08 IsWsl duration: 8.241µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 HasCommand duration: 19.067µs, args: git
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.283µs, args:
2022/05/08 18:02:08 error: HasParentFilePath
stat /.git: no such file or directory
2022/05/08 18:02:08 HasParentFilePath duration: 14.667µs, args: .git
2022/05/08 18:02:08 Flags duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.794µs, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 Root duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.283µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.794µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.793µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.863µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.212µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.863µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.794µs, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.933µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.353µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.933µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.933µs, args:
2022/05/08 18:02:08 GOOS duration: 977ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.282µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.863µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.794µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.422µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 error: CommandPath
not relevant
2022/05/08 18:02:08 HasCommand duration: 13.34µs, args: kubectl
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.213µs, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.864µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.352µs, args:
2022/05/08 18:02:08 PathSeparator duration: 978ns, args:
2022/05/08 18:02:08 debug: HasFiles
false
2022/05/08 18:02:08 HasFiles duration: 74.94µs, args: *.py
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 4.679µs, args:
2022/05/08 18:02:08 PathSeparator duration: 978ns, args:
2022/05/08 18:02:08 debug: HasFiles
false
2022/05/08 18:02:08 HasFiles duration: 50.495µs, args: *.ipynb
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.282µs, args:
2022/05/08 18:02:08 PathSeparator duration: 908ns, args:
2022/05/08 18:02:08 debug: HasFiles
false
2022/05/08 18:02:08 HasFiles duration: 17.041µs, args: pyproject.toml
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.933µs, args:
2022/05/08 18:02:08 PathSeparator duration: 908ns, args:
2022/05/08 18:02:08 debug: HasFiles
false
2022/05/08 18:02:08 HasFiles duration: 15.784µs, args: venv.bak
2022/05/08 18:02:08 debug: HasFolder
false
2022/05/08 18:02:08 HasFolder duration: 3.352µs, args: .venv
2022/05/08 18:02:08 debug: HasFolder
false
2022/05/08 18:02:08 HasFolder duration: 3.842µs, args: venv
2022/05/08 18:02:08 debug: HasFolder
false
2022/05/08 18:02:08 HasFolder duration: 3.911µs, args: virtualenv
2022/05/08 18:02:08 debug: HasFolder
false
2022/05/08 18:02:08 HasFolder duration: 6.076µs, args: env
2022/05/08 18:02:08 debug: HasFolder
false
2022/05/08 18:02:08 HasFolder duration: 3.841µs, args: venv-win
2022/05/08 18:02:08 debug: HasFolder
false
2022/05/08 18:02:08 HasFolder duration: 4.331µs, args: pyenv-win
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.352µs, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.352µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.352µs, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.772µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.283µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.911µs, args:
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 5.239µs, args: JAVA_HOME
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 4.749µs, args:
2022/05/08 18:02:08 GOOS duration: 2.375µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 4.749µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.794µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 4.33µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.352µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.701µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.772µs, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.352µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 2.793µs, args:
2022/05/08 18:02:08 GOOS duration: 977ns, args:
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 3.353µs, args: AWS_VAULT
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 3.282µs, args: AWS_PROFILE
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 3.283µs, args: AWS_REGION
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 3.353µs, args: AWS_DEFAULT_REGION
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 3.422µs, args: AWS_CONFIG_FILE
2022/05/08 18:02:08 error: FileContent
open /home/kamack38/.aws/config: no such file or directory
2022/05/08 18:02:08 FileContent duration: 12.292µs, args: /home/kamack38/.aws/config
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.282µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.282µs, args:
2022/05/08 18:02:08 debug: HasFolder
false
2022/05/08 18:02:08 HasFolder duration: 5.797µs, args: /home/kamack38/.terraform
2022/05/08 18:02:08 error: CommandPath
not relevant
2022/05/08 18:02:08 HasCommand duration: 16.622µs, args: terraform
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.772µs, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 Shell duration: 978ns, args:
2022/05/08 18:02:08 Flags duration: 977ns, args:
2022/05/08 18:02:08 TemplateCache duration: 1.466µs, args:
2022/05/08 18:02:08 TemplateCache duration: 1.955µs, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 4.819µs, args:
2022/05/08 18:02:08 GOOS duration: 908ns, args:
2022/05/08 18:02:08 ExecutionTime duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.282µs, args:
2022/05/08 18:02:08 GOOS duration: 978ns, args:
2022/05/08 18:02:08 ErrorCode duration: 978ns, args:
2022/05/08 18:02:08 TemplateCache duration: 978ns, args:
2022/05/08 18:02:08 TemplateCache duration: 977ns, args:
2022/05/08 18:02:08 TemplateCache duration: 978ns, args:
2022/05/08 18:02:08 Flags duration: 977ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 3.911µs, args:
2022/05/08 18:02:08 GOOS duration: 1.397µs, args:
2022/05/08 18:02:08 TemplateCache duration: 977ns, args:
2022/05/08 18:02:08 TemplateCache duration: 1.466µs, args:
2022/05/08 18:02:08 Flags duration: 978ns, args:
2022/05/08 18:02:08 debug: Pwd
/home/kamack38
2022/05/08 18:02:08 Pwd duration: 4.749µs, args:
2022/05/08 18:02:08 GOOS duration: 1.467µs, args:
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 4.819µs, args: WSL_DISTRO_NAME
2022/05/08 18:02:08 IsWsl duration: 12.432µs, args:
2022/05/08 18:02:08 debug: Getenv

2022/05/08 18:02:08 Getenv duration: 4.33µs, args: XDG_CACHE_HOME
2022/05/08 18:02:08 CachePath duration: 24.304µs, args:
2022/05/08 18:02:08 Flags duration: 978ns, args:
panic: runtime error: invalid memory address or nil pointer dereference
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x81 pc=0x77a701]

goroutine 1 [running]:
oh-my-posh/environment.(*ShellEnvironment).Trace(0x7f0104f715b8?, {0x10?, 0x1580ca0?, 0x15805c0?}, {0xb4fb9d?, 0x8?}, {0x0?, 0xc000157bd7?, 0x1?})
    /home/runner/work/oh-my-posh/oh-my-posh/src/environment/shell.go:300 +0x41
panic({0xab5e00, 0x1569100})
    /opt/hostedtoolcache/go/1.18.1/x64/src/runtime/panic.go:838 +0x207
oh-my-posh/environment.(*ShellEnvironment).Init(0xc000137260)
    /home/runner/work/oh-my-posh/oh-my-posh/src/environment/shell.go:232 +0x7c
oh-my-posh/cli.glob..func7(0x1574f80?, {0xc0002138f0, 0x1?, 0x1?})
    /home/runner/work/oh-my-posh/oh-my-posh/src/cli/get.go:34 +0x9b
github.com/spf13/cobra.(*Command).execute(0x1574f80, {0xc0002138c0, 0x1, 0x1})
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x1573b80)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
oh-my-posh/cli.Execute({0xc6e1f0?, 0xc0000021a0?})
    /home/runner/work/oh-my-posh/oh-my-posh/src/cli/root.go:40 +0x4a
main.main()
    /home/runner/work/oh-my-posh/oh-my-posh/src/main.go:10 +0x27
JanDeDobbeleer commented 2 years ago

@kamack38 please update to 7.79.6 which has the fix.

kamack38 commented 2 years ago

Fixed

github-actions[bot] commented 9 months ago

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.