feat(nu): update for 0.68.1

resolves #2756
This commit is contained in:
Jan De Dobbeleer 2022-09-25 19:43:16 +02:00 committed by Jan De Dobbeleer
parent 3948bef0b2
commit 66a55991f1
3 changed files with 21 additions and 19 deletions

View file

@ -1,21 +1,23 @@
let-env POWERLINE_COMMAND = 'oh-my-posh'
let-env POSH_THEME = ::CONFIG::
let-env PROMPT_INDICATOR = ""
# By default displays the right prompt on the first line
# making it annoying when you have a multiline prompt
# making the behavior different compared to other shells
let-env PROMPT_COMMAND_RIGHT = {''}
let-env NU_VERSION = (version | get version)
export-env {
let-env POWERLINE_COMMAND = 'oh-my-posh'
let-env POSH_THEME = ::CONFIG::
let-env PROMPT_INDICATOR = ""
# By default displays the right prompt on the first line
# making it annoying when you have a multiline prompt
# making the behavior different compared to other shells
let-env PROMPT_COMMAND_RIGHT = {''}
let-env NU_VERSION = (version | get version)
# PROMPTS
let-env PROMPT_MULTILINE_INDICATOR = (^::OMP:: print secondary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.NU_VERSION)")
# PROMPTS
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-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=($cmd_duration)" $"--error=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
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=($cmd_duration)" $"--error=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
}
}

View file

@ -160,7 +160,7 @@ Once altered, reload your config for the changes to take effect.
<TabItem value="nu">
:::caution
Oh My Posh requires Nushell v0.60.0 or higher.
Oh My Posh requires Nushell v0.68.1 or higher.
:::
Run the following command:

View file

@ -153,7 +153,7 @@ exec fish
<TabItem value="nu">
:::caution
Oh My Posh requires Nushell v0.60.0 or higher.
Oh My Posh requires Nushell v0.68.1 or higher.
:::
Run the following command: