mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-12-25 11:20:01 +00:00
chore: remove version check for unsupported nushell version (#4791)
This commit is contained in:
parent
4fa7395c9e
commit
fcdf2a0fb6
@ -263,8 +263,6 @@ the input line in a multi-line prompt, see the [`fill` module](/config/#fill).
|
||||
|
||||
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd, nushell.
|
||||
|
||||
Note: Nushell 0.71.0 or later is required
|
||||
|
||||
### Example
|
||||
|
||||
```toml
|
||||
|
@ -12,28 +12,17 @@ let-env PROMPT_COMMAND = {
|
||||
^::STARSHIP:: prompt $"--cmd-duration=($env.CMD_DURATION_MS)" $"--status=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
|
||||
}
|
||||
|
||||
# Whether we can show right prompt on the last line
|
||||
let has_rprompt_last_line_support = (version).version >= 0.71.0
|
||||
|
||||
# Whether we have config items
|
||||
let has_config_items = (not ($env | get -i config | is-empty))
|
||||
|
||||
if $has_rprompt_last_line_support {
|
||||
let config = if $has_config_items {
|
||||
$env.config | upsert render_right_prompt_on_last_line true
|
||||
} else {
|
||||
{render_right_prompt_on_last_line: true}
|
||||
}
|
||||
{config: $config}
|
||||
let config = if $has_config_items {
|
||||
$env.config | upsert render_right_prompt_on_last_line true
|
||||
} else {
|
||||
{ }
|
||||
} | load-env
|
||||
{render_right_prompt_on_last_line: true}
|
||||
}
|
||||
{config: $config} | load-env
|
||||
|
||||
let-env PROMPT_COMMAND_RIGHT = {
|
||||
if $has_rprompt_last_line_support {
|
||||
let width = (term size).columns
|
||||
^::STARSHIP:: prompt --right $"--cmd-duration=($env.CMD_DURATION_MS)" $"--status=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
|
||||
} else {
|
||||
''
|
||||
}
|
||||
let width = (term size).columns
|
||||
^::STARSHIP:: prompt --right $"--cmd-duration=($env.CMD_DURATION_MS)" $"--status=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user