Closed muchisx closed 2 years ago
I have the same problem 😞
I cannot reproduce it on my end using the same "atomic" theme, neither in VSCode nor in Windows Terminal. 😶
I believe this is because in the Update-PoshErrorCode
function, we do not set a default value which means it can exit with leaving $script:ErrorCode
blank on the first run (which is also what I see here). Added the default 0 which should resolve this.
So, I know it's a closed issue now but how do i solve the issue on my end? Can I tweak something or i gotta wait for the next release and update?
The next release should already be out there. Winget takes a while on their end, but you can take the installer from the releases page which is what Winget also uses anyways.
@muchisx Have you tried the latest release? I just wonder whether it is fixed. However, I think it's $script:ExecutionTime
that doesn't get a value, not $script:ErrorCode
...
I believe this is because in the
Update-PoshErrorCode
function, we do not set a default value which means it can exit with leaving$script:ErrorCode
blank on the first run (which is also what I see here). Added the default 0 which should resolve this.
@JanDeDobbeleer I don't think we have to add an extra line of $script:ErrorCode = 0
. We already have one that sets a default zero value for the error code during the initialization (before the first run):
@lewis-yeung in that case, sorry I missed that, there's potentially an empty value for one of the options we do set. Which requires additional validation.
@muchisx which PowerShell version is this?
I'm sorry everyone, I was chasing ghosts here. Not sure why my mind read errorcode when it's about execution time...
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?
This error appears entering any command with the integrated vscode powershell 7
Error: invalid argument "" for "--execution-time" flag: strconv.ParseFloat: parsing "": invalid syntax
Flags: --command string tooltip command -e, --error int last exit code --eval output the prompt for eval --execution-time float timing of the last command -h, --help help for print -p, --plain plain text output (no ANSI) --pswd string current working directory (according to pwsh) --pwd string current working directory --shell string the shell to print for --shell-version string the shell version -s, --stack-count int number of locations on the stack -w, --terminal-width int width of the terminal
Global Flags: -c, --config string config (required)
I have not modified anythinc in the theme, just installed it normally as following the guides.
This error also is reproduced in Windows Terminal
Theme
Atomic theme https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/atomic.omp.json
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output