From 0eb9a36ce6a37653b1a58ebcb592da8e549bfd2b Mon Sep 17 00:00:00 2001 From: RGBCube Date: Sat, 12 Jul 2025 18:44:20 +0300 Subject: [PATCH] nushell: show exit code in prompt --- modules/common/nushell/config.nu | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/common/nushell/config.nu b/modules/common/nushell/config.nu index 75f25e3..241cc66 100644 --- a/modules/common/nushell/config.nu +++ b/modules/common/nushell/config.nu @@ -222,7 +222,13 @@ do --env { $"(ansi cyan)($pwd)(ansi reset)" } - $"(ansi light_yellow_bold)($left_char)━━━(ansi reset) ($body)(char newline)" + let middle = if $env.LAST_EXIT_CODE == 0 { + "━" + } else { + $"┫(ansi light_red_bold)($env.LAST_EXIT_CODE)(ansi light_yellow_bold)┣" + } + + $"(ansi light_yellow_bold)($left_char)($middle)━(ansi reset) ($body)(char newline)" } $env.PROMPT_INDICATOR = $"(ansi light_yellow_bold)┃(ansi reset) "