mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 13:04:04 -08:00
fix(nu): set initial execution time to 0
This commit is contained in:
parent
22da6bd96d
commit
2f4ebfc493
|
@ -11,6 +11,11 @@ let-env NU_VERSION = (version | get version)
|
|||
let-env PROMPT_MULTILINE_INDICATOR = (^::OMP:: print secondary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.NU_VERSION)")
|
||||
|
||||
let-env PROMPT_COMMAND = {
|
||||
# We have to do this because the initial value of `$env.CMD_DURATION_MS` is always `0823`,
|
||||
# which is an official setting.
|
||||
# See https://github.com/nushell/nushell/discussions/6402#discussioncomment-3466687.
|
||||
let cmd_duration = if $env.CMD_DURATION_MS == "0823" { 0 } else { $env.CMD_DURATION_MS }
|
||||
|
||||
let width = (term size -c | get columns | into string)
|
||||
^::OMP:: print primary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.NU_VERSION)" $"--execution-time=($env.CMD_DURATION_MS)" $"--error=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
|
||||
^::OMP:: print primary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.NU_VERSION)" $"--execution-time=($cmd_duration)" $"--error=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue