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

Prompt does not show - gets not modified in pwsh #2113

Closed woha closed 2 years ago

woha commented 2 years ago

Code of Conduct

What happened?

After updating to the latest version (v7.66.0) oh-my-posh stopped working in pwsh on all my machines. Instead of the modified prompt, the default prompt ist shown (PS>).

Theme

$env:POSH_THEMES_PATH\jandedobbeleer.omp.json

What OS are you seeing the problem on?

Windows, macOS

Which shell are you using?

powershell

Log output

PS>oh-my-posh debug

Version: 7.66.0

Segments:

ConsoleTitle(true) -   0 ms - pwsh in ~
session(true)  -   0 ms -  wolfg 
path(true)     -   0 ms -   ~
git(false)     -   7 ms -
root(false)    -   0 ms -
exit(true)     -   0 ms -   
node(false)    -   0 ms -
go(false)      -   0 ms -
python(false)  -   0 ms -
shell(true)    -   1 ms - in pwsh
time(true)     -   0 ms - at 14:32:53

Run duration: 10.8627ms

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

Logs:

2022/04/20 14:32:53 Flags duration: 0s, args:
2022/04/20 14:32:53 Flags duration: 0s, args:
2022/04/20 14:32:53 debug: Getenv

2022/04/20 14:32:53 Getenv duration: 408.5µs, args: OMP_CACHE_DISABLED
2022/04/20 14:32:53 Root duration: 0s, args:
2022/04/20 14:32:53 Shell duration: 0s, args:
2022/04/20 14:32:53 ErrorCode duration: 0s, args:
2022/04/20 14:32:53 IsWsl duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 debug: User
wolfg
2022/04/20 14:32:53 User duration: 0s, args:
2022/04/20 14:32:53 debug: Host
PC-004
2022/04/20 14:32:53 Host duration: 99.3µs, args:
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 TemplateCache duration: 605.1µs, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 debug: Getenv

2022/04/20 14:32:53 Getenv duration: 0s, args: SSH_CONNECTION
2022/04/20 14:32:53 debug: Getenv

2022/04/20 14:32:53 Getenv duration: 0s, args: SSH_CLIENT
2022/04/20 14:32:53 TemplateCache duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 Flags duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 IsWsl duration: 0s, args:
2022/04/20 14:32:53 StackCount duration: 0s, args:
2022/04/20 14:32:53 TemplateCache duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 HasCommand duration: 6.5814ms, args: git.exe
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 error: HasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/04/20 14:32:53 HasParentFilePath duration: 548.5µs, args: .git
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 Root duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 ErrorCode duration: 0s, args:
2022/04/20 14:32:53 TemplateCache duration: 0s, args:
2022/04/20 14:32:53 TemplateCache duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 debug: HasFiles
false
2022/04/20 14:32:53 HasFiles duration: 0s, args: *.py
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 debug: HasFiles
false
2022/04/20 14:32:53 HasFiles duration: 588.8µs, args: *.ipynb
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 debug: HasFiles
false
2022/04/20 14:32:53 HasFiles duration: 0s, args: pyproject.toml
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 debug: HasFiles
false
2022/04/20 14:32:53 HasFiles duration: 0s, args: venv.bak
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 debug: HasFiles
false
2022/04/20 14:32:53 HasFiles duration: 0s, args: venv
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 PathSeparator duration: 0s, args:
2022/04/20 14:32:53 debug: HasFiles
false
2022/04/20 14:32:53 HasFiles duration: 0s, args: .venv
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 Shell duration: 0s, args:
2022/04/20 14:32:53 TemplateCache duration: 0s, args:
2022/04/20 14:32:53 debug: Pwd
C:\Users\wolfg
2022/04/20 14:32:53 Pwd duration: 0s, args:
2022/04/20 14:32:53 debug: Home
C:\Users\wolfg
2022/04/20 14:32:53 GOOS duration: 0s, args:
2022/04/20 14:32:53 TemplateCache duration: 0s, args:
2022/04/20 14:32:53 debug: Getenv
C:\Users\wolfg\AppData\Local
2022/04/20 14:32:53 Getenv duration: 0s, args: LOCALAPPDATA
2022/04/20 14:32:53 CachePath duration: 0s, args:
PS>
JanDeDobbeleer commented 2 years ago

@woha what does $error say?

woha commented 2 years ago

PS>$error

ErrorRecord : The term 'Get-GitStatus' 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. CommandName : Get-GitStatus WasThrownFromThrowStatement : False TargetSite : System.Collections.ObjectModel.Collection`1[System.Management.Automation.PSObject] Invoke(System.Collections.IEnumerable) Message : The term 'Get-GitStatus' 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. Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo} InnerException : HelpLink : Source : System.Management.Automation HResult : -2146233087 StackTrace : at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.Runspaces.Pipeline.Invoke() at Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception& exceptionThrown, ExecutionOptions options)

Get-GitStatus: Line | 63 | $global:GitStatus = Get-GitStatus | ~~~~~ | The term 'Get-GitStatus' 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.

PS>

On Wed, Apr 20, 2022 at 2:50 PM Jan De Dobbeleer @.***> wrote:

@woha https://github.com/woha what does $error say?

— Reply to this email directly, view it on GitHub https://github.com/JanDeDobbeleer/oh-my-posh/issues/2113#issuecomment-1103894806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECYWTYGIQKO2VVZLY7JMSLVF74SFANCNFSM5T34VZWQ . You are receiving this because you were mentioned.Message ID: @.***>

woha commented 2 years ago

Looks like posh-git is missing / not loaded. But why is this causing an issue now and not in previous versions?

woha commented 2 years ago

@JanDeDobbeleer Thank you very much for your help and immediate answer. You have a new sponsor now and GitKraken a new PRO customer!

JanDeDobbeleer commented 2 years ago

@woha thanks! We only run Get-GitStatus when $env:POSH_GIT_ENABLED -eq $true. Can it be that was somehow in your profile?

woha commented 2 years ago

Yes, $env:POSH_GIT_ENABLED = $true is in my $PROFILE, but it's there "forever". Nevermind, I'm sure it's my fault. @JanDeDobbeleer Thank you again!

JanDeDobbeleer commented 2 years ago

@woha yes, we only recently reintroduced that logic. It was away for a while which is why the issue reappeared on your end.

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.