Prompt not displayed from 21.23.3 #5281
Replies: 13 comments 13 replies
-
I am experiencing the same issue. For me it also started to happen from version 21.23.3 In my case prompt theme is being fully reset when we try to override Function:Prompt (which worked perfectly before the update 21.23.3 and further updates).
Content of Function:Prompt
I tested scenario when I updated Function:Prompt value without any changes, and theme resets in this case too.
Maybe this information will be useful to debug |
Beta Was this translation helpful? Give feedback.
-
Reproduced on my end. We've done some changes related to the prompt function in PowerShell. Will try to fix it. |
Beta Was this translation helpful? Give feedback.
-
@nbdinara Are you sure the above code worked before? I tested it but it didn't even work (resulting in a fallback prompt |
Beta Was this translation helpful? Give feedback.
-
@lewis-yeung , this is what I see: v21.23.2 - theme is not being reset v21.23.3 - theme is being reset On screenshots above I execute function that has code I specified above (and you can see the function content on the screenshots as well). You can see that everything worked fine on version 21.23.2. On version 21.23.3 theme is being reset after function execution. But it is interesting that if I run code line by line in console window instead of using function, theme is being reset even if the version of oh-my-posh is v21.23.2. |
Beta Was this translation helpful? Give feedback.
-
@nbdinara I still cannot get the example to work in v21.23.2, either in a function or running line by line. What's your PowerShell version? |
Beta Was this translation helpful? Give feedback.
-
@dpokluda @nbdinara What does the |
Beta Was this translation helpful? Give feedback.
-
@nbdinara This should be a scope related issue. Many OMP functions called inside the |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Got the same error on PowerShell v7.4.3:
@nbdinara If you would like to wrap the $originalPromptFunction = $Function:prompt
function prompt {
$originalOutput = $originalPromptFunction.Invoke()
# Some code...
} |
Beta Was this translation helpful? Give feedback.
-
@nbdinara I had a few debug runs here and it's safe to say this isn't supported. There are so many side effects here when hijacking the prompt function, if you want to display additional text it's better to override |
Beta Was this translation helpful? Give feedback.
-
@dpokluda I still need your |
Beta Was this translation helpful? Give feedback.
-
I run some more tests. It is interesting how the same code leads to different behavior depending on how it is being executed: ![]() |
Beta Was this translation helpful? Give feedback.
-
I tried the solution that you suggested. Works great! Thank you very much for your time and help. |
Beta Was this translation helpful? Give feedback.
-
Code of Conduct
What happened?
Today, after installing latest version of oh-my-posh, I don't see my prompt being rendered (only
PS>
). I have tried multiple versions, and it seems to start since 21.23.3 (it works with 21.23.2 but no version after). I tried to search for similar issues but didn't find anything relevant.I am not sure if my custom theme contains anything special that is no longer supported but the version 21.23.3 doesn't talk about deprecating any previous feature.
When comparing
debug
output from 21.23.2 to newer version, I am noticing some changes but nothing that would clearly explain what is wrong (not working) in the current version.Theme
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output
Beta Was this translation helpful? Give feedback.
All reactions