oh-my-posh: home_enabled not working for node in ZSH

Code of Conduct

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

What happened?

First off, I should probably say that this shell is not really normal. I’m running Git Bash with zsh (and oh-my-zsh) installed, with oh-my-posh to use the same prompt across shells and WSL with the same config file.

Setting home_enabled to false in my configuration is not removing my node version from my prompt when in my home directory. This same config works fine on PowerShell however (did not test on cmd). image

The node section of my config looks like this:

                {
                    "type": "node",
                    "style": "plain",
                    "foreground": "#6FBC4F",
                    "properties": {
                        "prefix": " ",
                        "home_enabled": "false",
                        "display_mode": "files",
                        "enable_version_mismatch": true,
                        "fetch_package_manager": true
                    }
                }

Theme

You can see my full config here: https://gist.github.com/dheerajpv/a8c471021e975c59f906b936b9063438

What OS are you seeing the problem on?

Windows

Which shell are you using?

zsh

Log output

Version: 7.0.0

Segments:

ConsoleTitle(true)   -   0 ms - 
session(true)        -   0 ms - ∩öê dheer on
os(true)             -   0 ms -   
path(true)           -   0 ms -  ]8;;file://C:\Users\dheer\~]8;;\ 
git(false)           -   0 ms - 
node(false)          -   0 ms - 
python(false)        -   0 ms - 
dotnet(false)        -   0 ms - 
executiontime(false) -   0 ms - 
time(true)           -   0 ms -  14:01:54 
exit(true)           -   0 ms - # 

Run duration: 1.0415ms

Cache path: C:\Users\dheer\AppData\Local/oh-my-posh

Logs:

2022/01/18 14:01:54 debug: getenv
C:\Users\dheer\AppData\Local
2022/01/18 14:01:54 getenv duration: 0s, args: LOCALAPPDATA
2022/01/18 14:01:54 getCachePath duration: 0s, args: 
2022/01/18 14:01:54 getArgs duration: 0s, args: 
2022/01/18 14:01:54 getArgs duration: 0s, args: 
2022/01/18 14:01:54 getShellName duration: 515.3┬╡s, args: 
2022/01/18 14:01:54 debug: getenv

2022/01/18 14:01:54 getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/01/18 14:01:54 isRunningAsRoot duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getPathSeperator duration: 0s, args: 
2022/01/18 14:01:54 getPathSeperator duration: 0s, args: 
2022/01/18 14:01:54 getShellName duration: 0s, args: 
2022/01/18 14:01:54 getCurrentUser duration: 0s, args: 
2022/01/18 14:01:54 getHostName duration: 0s, args: 
2022/01/18 14:01:54 lastErrorCode duration: 0s, args: 
2022/01/18 14:01:54 environ duration: 0s, args: 
2022/01/18 14:01:54 getRuntimeGOOS duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 debug: getenv

2022/01/18 14:01:54 getenv duration: 0s, args: SSH_CONNECTION
2022/01/18 14:01:54 debug: getenv

2022/01/18 14:01:54 getenv duration: 0s, args: SSH_CLIENT
2022/01/18 14:01:54 getCurrentUser duration: 0s, args: 
2022/01/18 14:01:54 getRuntimeGOOS duration: 0s, args: 
2022/01/18 14:01:54 debug: getenv

2022/01/18 14:01:54 getenv duration: 0s, args: POSH_SESSION_DEFAULT_USER
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getRuntimeGOOS duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getArgs duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getRuntimeGOOS duration: 0s, args: 
2022/01/18 14:01:54 getRuntimeGOOS duration: 0s, args: 
2022/01/18 14:01:54 getPathSeperator duration: 0s, args: 
2022/01/18 14:01:54 getArgs duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getRuntimeGOOS duration: 0s, args: 
2022/01/18 14:01:54 getRuntimeGOOS duration: 0s, args: 
2022/01/18 14:01:54 getPathSeperator duration: 0s, args: 
2022/01/18 14:01:54 getRuntimeGOOS duration: 0s, args: 
2022/01/18 14:01:54 isWsl duration: 0s, args: 
2022/01/18 14:01:54 stackCount duration: 0s, args: 
2022/01/18 14:01:54 isRunningAsRoot duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getPathSeperator duration: 0s, args: 
2022/01/18 14:01:54 getPathSeperator duration: 0s, args: 
2022/01/18 14:01:54 getShellName duration: 0s, args: 
2022/01/18 14:01:54 getCurrentUser duration: 0s, args: 
2022/01/18 14:01:54 getHostName duration: 0s, args: 
2022/01/18 14:01:54 lastErrorCode duration: 0s, args: 
2022/01/18 14:01:54 environ duration: 0s, args: 
2022/01/18 14:01:54 getRuntimeGOOS duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getRuntimeGOOS duration: 0s, args: 
2022/01/18 14:01:54 hasCommand duration: 525.2┬╡s, args: git.exe
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 error: hasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/01/18 14:01:54 hasParentFilePath duration: 0s, args: .git
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 debug: getenv

2022/01/18 14:01:54 getenv duration: 0s, args: VIRTUAL_ENV
2022/01/18 14:01:54 debug: getenv

2022/01/18 14:01:54 getenv duration: 0s, args: CONDA_ENV_PATH
2022/01/18 14:01:54 debug: getenv

2022/01/18 14:01:54 getenv duration: 0s, args: CONDA_DEFAULT_ENV
2022/01/18 14:01:54 debug: getenv

2022/01/18 14:01:54 getenv duration: 0s, args: PYENV_VERSION
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 executionTime duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 getcwd duration: 0s, args: 
2022/01/18 14:01:54 lastErrorCode duration: 0s, args: 
2022/01/18 14:01:54 debug: getenv
C:\Users\dheer\AppData\Local
2022/01/18 14:01:54 getenv duration: 0s, args: LOCALAPPDATA
2022/01/18 14:01:54 getCachePath duration: 0s, args:

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (11 by maintainers)

Commits related to this issue

Most upvoted comments

works now, thanks!

Yes, I’m using the same config for both cases: image

Also, it works as intended in powershell so it shouldn’t be a configuration issue.