Closed janegilring closed 1 year ago
@janegilring that statement is completely invalid though. You're overriding the prompt function with one that overrides the function again... This is in no way supported.
Ok, maybe I used incorrect wording. Isn't it supported to start with one prompt where oh-my-posh is not enabled and after the first prompt's thread job is finished enable oh-my-posh? Also, why is it working on Windows?
@janegilring good question, no idea. I can have a look at solving the issue though, it's seeing why the default initialization is different per platform, that's strange as the code is identical in that area.
Thanks.
I also tried to install the latest versions of v17 and v16 just to see if it behaves differently with previous versions.
The only difference I noticed is that the error is slightly different in v16:
Error: invalid argument "" for "--no-exit-code" flag: strconv.ParseBool: parsing "": invalid syntax
I have also tried on Linux (Ubuntu 22.04), and the issue is present there as well.
Thanks for the quick fix, I've upgraded and verified it's resolved 👌
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.
Code of Conduct
What happened?
I am using this approach where I store my profile in a GitHub Gist to have it available across machines (Windows/MacOS/Linux).
This works great except on MacOs, where I get this error when launching a new PowerShell instance and either pressing Enter or typing a command and pressing Enter:
Error: invalid argument "" for "--no-status" flag: strconv.ParseBool: parsing "": invalid syntax
After the error, the prompt is correctly changed to the one defined in the profile file.
To repro, put this in the PowerShell profile file:
If calling the command outside of the prompt function, it works without errors - but that breaks the lazy loading of the profile as seen in this Gist.
Also, note that the issue is only present on MacOS. The synchronized Gist works fine on Windows (not tested on Linux yet).
Theme
night-owl.omp.json
What OS are you seeing the problem on?
macOS
Which shell are you using?
powershell
Log output