mirror of
https://github.com/RGBCube/ncc
synced 2025-07-28 10:37:44 +00:00
nushell: fix prompt
This commit is contained in:
parent
7446c09c73
commit
f4cda80d94
1 changed files with 4 additions and 2 deletions
|
@ -179,6 +179,8 @@ do --env {
|
|||
def prompt-header [
|
||||
--left-char: string
|
||||
]: nothing -> string {
|
||||
let code = $env.LAST_EXIT_CODE
|
||||
|
||||
let jj_workspace_root = try {
|
||||
jj workspace root err> $null_device
|
||||
} catch {
|
||||
|
@ -221,10 +223,10 @@ do --env {
|
|||
$"┫(ansi light_magenta_bold)($command_duration)(ansi light_yellow_bold)┣━"
|
||||
}
|
||||
|
||||
let exit_code = if $env.LAST_EXIT_CODE == 0 {
|
||||
let exit_code = if $code == 0 {
|
||||
""
|
||||
} else {
|
||||
$"┫(ansi light_red_bold)($env.LAST_EXIT_CODE)(ansi light_yellow_bold)┣━"
|
||||
$"┫(ansi light_red_bold)($code)(ansi light_yellow_bold)┣━"
|
||||
}
|
||||
|
||||
let middle = if $command_duration == "" and $exit_code == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue