1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-28 18:47:44 +00:00

nushell: fix prompt

This commit is contained in:
RGBCube 2025-07-17 04:25:19 +03:00
parent 7446c09c73
commit f4cda80d94
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M

View file

@ -179,6 +179,8 @@ do --env {
def prompt-header [ def prompt-header [
--left-char: string --left-char: string
]: nothing -> string { ]: nothing -> string {
let code = $env.LAST_EXIT_CODE
let jj_workspace_root = try { let jj_workspace_root = try {
jj workspace root err> $null_device jj workspace root err> $null_device
} catch { } catch {
@ -221,10 +223,10 @@ do --env {
$"┫(ansi light_magenta_bold)($command_duration)(ansi light_yellow_bold)┣━" $"┫(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 { } 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 == "" { let middle = if $command_duration == "" and $exit_code == "" {