From f4cda80d94aa834a68ac5f48e6622fab27d24386 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Thu, 17 Jul 2025 04:25:19 +0300 Subject: [PATCH] nushell: fix prompt --- modules/common/nushell/config.nu | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/common/nushell/config.nu b/modules/common/nushell/config.nu index 82acb94..482a816 100644 --- a/modules/common/nushell/config.nu +++ b/modules/common/nushell/config.nu @@ -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 == "" {