JanDeDobbeleer / oh-my-posh

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

Windows Terminal "sticks" to a theme #2180

Closed ehawman-rosenberg closed 2 years ago

ehawman-rosenberg commented 2 years ago

Code of Conduct

What happened?

So I updated my remote config file and OMP refuses to get the memo. In fact, it refuses to let go of my old config for any remote config.

Old URL: https://gist.githubusercontent.com/ehawman-rosenberg/50b3b695526f03690cfd396d02c2cca3/raw/c2e0bc78cdf551b0cc76f593e4fd70428f981c0e/eh-tea.omp.json

New URL: https://gist.githubusercontent.com/ehawman-rosenberg/0b3b24ede3f081979634b7fa6d2fd91e/raw/1f735b63477c7002a6920f748e00d4342c1df2e9/dracula-diamonds.omp.json

Note that I changed the filenames here, if that's relevant.

In my PWSH $PROFILE with the new URL:

$themeJsonUrl = "https://gist.githubusercontent.com/ehawman-rosenberg/0b3b24ede3f081979634b7fa6d2fd91e/raw/1f735b63477c7002a6920f748e00d4342c1df2e9/dracula-diamonds.omp.json"
oh-my-posh --init --shell pwsh --config $themeJsonUrl | Invoke-Expression

Result: image (My old prompt, with "Thursday" written all the way out)

Now, I change out my oh-my-posh calling block for the following:

# Allows loading of local theme file. Retained for future development work.
$ThemePath = "$env:POSH_THEMES_PATH\eh_custom\"
if (Test-Path -Path $ThemePath) {
    # Write-Host "Pull"
    git -C $ThemePath pull "https://gist.github.com/ehawman-rosenberg/0b3b24ede3f081979634b7fa6d2fd91e" *> $null
}
else {
    # Write-Host "Clone"
    git clone "https://gist.github.com/ehawman-rosenberg/0b3b24ede3f081979634b7fa6d2fd91e" $ThemePath
}
oh-my-posh --init --shell pwsh --config $ThemePath/dracula-diamonds.omp.json | Invoke-Expression

Note that this is the exact same gist, but it first clones it locally and points to the local file.

Result: image The new one!

Going back to the original remote config block, let's put the default JanDeDobbeleer config in, shall we?

$themeJsonUrl = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json"
oh-my-posh --init --shell pwsh --config $themeJsonUrl | Invoke-Expression

Result: image Wat.

Please help me exorcise this thematic ghost!

Theme

https://gist.githubusercontent.com/ehawman-rosenberg/0b3b24ede3f081979634b7fa6d2fd91e/raw/1db88b7fad8f8b4348f6d7030914f4396c47b558/dracula-diamonds.omp.json

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 7.74.0

Segments:

ConsoleTitle(true)   -   0 ms - ~
os(true)             -   0 ms -  ═
shell(true)          -   0 ms -   pwsh
session(true)        -   0 ms - ehawman@EHSupportLaptop
julia(false)         -   0 ms -
go(false)            -   1 ms -
java(false)          -   0 ms -
php(false)           -   0 ms -
node(false)          -   0 ms -
azfunc(false)        -   0 ms -
ruby(false)          -   0 ms -
kubectl(false)       -  21 ms -
python(false)        -   0 ms -
aws(false)           -   0 ms -
time(true)           -   0 ms -   Thursday | 10:39:12 AM 
executiontime(true)  -   0 ms -  0ms 
git(false)           -  16 ms -
text(true)           -   0 ms -  ╚
exit(true)           -   0 ms -  
path(true)           -   0 ms -   
text(true)           -   1 ms - ​
exit(false)          -   1 ms -

Run duration: 45.4833ms

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

Logs:

2022/04/28 10:39:12 Flags duration: 0s, args:
2022/04/28 10:39:12 Flags duration: 0s, args:
2022/04/28 10:39:12 debug: Getenv

2022/04/28 10:39:12 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/04/28 10:39:12 Root duration: 0s, args:
2022/04/28 10:39:12 Shell duration: 0s, args:
2022/04/28 10:39:12 ErrorCode duration: 0s, args:
2022/04/28 10:39:12 IsWsl duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 PathSeparator duration: 0s, args:
2022/04/28 10:39:12 PathSeparator duration: 0s, args:
2022/04/28 10:39:12 debug: User
ehawman
2022/04/28 10:39:12 User duration: 0s, args:
2022/04/28 10:39:12 debug: Host
EHSupportLaptop
2022/04/28 10:39:12 Host duration: 0s, args:
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 Shell duration: 0s, args:
2022/04/28 10:39:12 Flags duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Getenv

2022/04/28 10:39:12 Getenv duration: 0s, args: SSH_CONNECTION
2022/04/28 10:39:12 debug: Getenv

2022/04/28 10:39:12 Getenv duration: 0s, args: SSH_CLIENT
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 debug: Getenv

2022/04/28 10:39:12 Getenv duration: 0s, args: JAVA_HOME
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Getenv
C:\Users\ehawman\AppData\Local
2022/04/28 10:39:12 Getenv duration: 0s, args: LOCALAPPDATA
2022/04/28 10:39:12 PathSeparator duration: 0s, args:
2022/04/28 10:39:12 debug: HasFilesInDir
false
2022/04/28 10:39:12 HasFilesInDir duration: 1.0035ms, args: kubectl.exe
2022/04/28 10:39:12 error: CommandPath
no Windows Store App
2022/04/28 10:39:12 HasCommand duration: 21.741ms, args: kubectl
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 PathSeparator duration: 0s, args:
2022/04/28 10:39:12 debug: HasFiles
false
2022/04/28 10:39:12 HasFiles duration: 0s, args: *.py
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 PathSeparator duration: 0s, args:
2022/04/28 10:39:12 debug: HasFiles
false
2022/04/28 10:39:12 HasFiles duration: 0s, args: *.ipynb
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 PathSeparator duration: 0s, args:
2022/04/28 10:39:12 debug: HasFiles
false
2022/04/28 10:39:12 HasFiles duration: 0s, args: pyproject.toml
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 PathSeparator duration: 0s, args:
2022/04/28 10:39:12 debug: HasFiles
false
2022/04/28 10:39:12 HasFiles duration: 0s, args: venv.bak
2022/04/28 10:39:12 debug: HasFolder
false
2022/04/28 10:39:12 HasFolder duration: 0s, args: .venv
2022/04/28 10:39:12 debug: HasFolder
false
2022/04/28 10:39:12 HasFolder duration: 0s, args: venv
2022/04/28 10:39:12 debug: HasFolder
false
2022/04/28 10:39:12 HasFolder duration: 0s, args: virtualenv
2022/04/28 10:39:12 debug: HasFolder
false
2022/04/28 10:39:12 HasFolder duration: 0s, args: env
2022/04/28 10:39:12 debug: HasFolder
false
2022/04/28 10:39:12 HasFolder duration: 0s, args: venv-win
2022/04/28 10:39:12 debug: HasFolder
false
2022/04/28 10:39:12 HasFolder duration: 991.9µs, args: pyenv-win
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Getenv

2022/04/28 10:39:12 Getenv duration: 0s, args: AWS_VAULT
2022/04/28 10:39:12 debug: Getenv

2022/04/28 10:39:12 Getenv duration: 0s, args: AWS_PROFILE
2022/04/28 10:39:12 debug: Getenv

2022/04/28 10:39:12 Getenv duration: 0s, args: AWS_REGION
2022/04/28 10:39:12 debug: Getenv

2022/04/28 10:39:12 Getenv duration: 0s, args: AWS_DEFAULT_REGION
2022/04/28 10:39:12 debug: Getenv

2022/04/28 10:39:12 Getenv duration: 0s, args: AWS_CONFIG_FILE
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 error: FileContent
open C:\Users\ehawman/.aws/config: The system cannot find the path specified.
2022/04/28 10:39:12 FileContent duration: 0s, args: C:\Users\ehawman/.aws/config
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 ExecutionTime duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 HasCommand duration: 15.9993ms, args: git.exe
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 error: HasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/04/28 10:39:12 HasParentFilePath duration: 1.0004ms, args: .git
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 ErrorCode duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 Flags duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 PathSeparator duration: 0s, args:
2022/04/28 10:39:12 Flags duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 PathSeparator duration: 0s, args:
2022/04/28 10:39:12 PathSeparator duration: 0s, args:
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 IsWsl duration: 0s, args:
2022/04/28 10:39:12 StackCount duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Pwd
C:\Users\ehawman
2022/04/28 10:39:12 Pwd duration: 0s, args:
2022/04/28 10:39:12 debug: Home
C:\Users\ehawman
2022/04/28 10:39:12 GOOS duration: 0s, args:
2022/04/28 10:39:12 ErrorCode duration: 0s, args:
2022/04/28 10:39:12 TemplateCache duration: 0s, args:
2022/04/28 10:39:12 debug: Getenv
C:\Users\ehawman\AppData\Local
2022/04/28 10:39:12 Getenv duration: 0s, args: LOCALAPPDATA
2022/04/28 10:39:12 CachePath duration: 0s, args:
ehawman-rosenberg commented 2 years ago

Ah I just read the logs and cleared the cache. I'm now defaulting to the JanDeDobbeleer one.

So presumably I've borked the formatting somewhere and it's failing to cache/default.

However that doesn't explain why I'm able to git clone the new one and initiate it just fine.

JanDeDobbeleer commented 2 years ago

@ehawman-rosenberg did you restart the shell? As it only downloads it on init (a shell start). I'll validate this evening.

ehawman-rosenberg commented 2 years ago

Ok I've solved it (or rather, I understand the first part of what's going wrong).

If there is no 7.74.0.omp.json in %APPDATA%\Local\oh-my-posh, then a remote config will set it. Otherwise, remote configs are given the boot (local configs appear to be fine).

ehawman-rosenberg commented 2 years ago

@JanDeDobbeleer Restarted each time, including relaunching WT entirely.

JanDeDobbeleer commented 2 years ago

@ehawman-rosenberg a bug indeed. Fix incoming.

github-actions[bot] commented 7 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.