feat(nu): Add job support for nushell (#6684)

* Add job support for nushell

* Do not raise minimum supported nushell version

* Update documentation about job support on nushell
This commit is contained in:
Bahex
2025-05-28 00:24:39 +03:00
committed by GitHub
parent d15c183505
commit ac2359ca8a
2 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -2502,7 +2502,7 @@ The default functionality is:
::: warning ::: warning
This module is not supported on tcsh and nu. This module is not supported on tcsh.
::: :::
+14 -1
View File
@@ -13,12 +13,18 @@ export-env { $env.STARSHIP_SHELL = "nu"; load-env {
PROMPT_INDICATOR: "" PROMPT_INDICATOR: ""
PROMPT_COMMAND: {|| PROMPT_COMMAND: {||
# jobs are not supported
( (
^::STARSHIP:: prompt ^::STARSHIP:: prompt
--cmd-duration $env.CMD_DURATION_MS --cmd-duration $env.CMD_DURATION_MS
$"--status=($env.LAST_EXIT_CODE)" $"--status=($env.LAST_EXIT_CODE)"
--terminal-width (term size).columns --terminal-width (term size).columns
...(
if (which "job list" | where type == built-in | is-not-empty) {
["--jobs", (job list | length)]
} else {
[]
}
)
) )
} }
@@ -33,6 +39,13 @@ export-env { $env.STARSHIP_SHELL = "nu"; load-env {
--cmd-duration $env.CMD_DURATION_MS --cmd-duration $env.CMD_DURATION_MS
$"--status=($env.LAST_EXIT_CODE)" $"--status=($env.LAST_EXIT_CODE)"
--terminal-width (term size).columns --terminal-width (term size).columns
...(
if (which "job list" | where type == built-in | is-not-empty) {
["--jobs", (job list | length)]
} else {
[]
}
)
) )
} }
}} }}