From 4f8c45c4ef7ed51c84cbf34ccc3b5b55ed4b03b8 Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 00:51:55 -0400 Subject: [PATCH] fix: restore docker context behind starship+C3 guard, use long date format in right prompt --- docs/fish-config.md | 10 ++++++---- functions/fish_right_prompt.fish | 21 ++++++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/fish-config.md b/docs/fish-config.md index 11ddfd7..2041425 100644 --- a/docs/fish-config.md +++ b/docs/fish-config.md @@ -1593,7 +1593,7 @@ all of them. Starship prompt fish_prompt replaced by Starship + OSC 133 markers Catppuccin colors 30+ fish_color_* variables set to Mocha palette FZF_DEFAULT_OPTS FZF themed to Catppuccin Mocha colors - Right prompt fish_right_prompt: exit code (on failure) + dim timestamp; always rendered + Right prompt fish_right_prompt: exit code (on failure) + dim timestamp; always rendered; Docker context added when starship+C3 active The bang-bang system spans key_bindings.fish, abbr.fish, puffer.fish, and six expand_bang_*.fish functions. All are gated together — disabling C3 @@ -1717,10 +1717,12 @@ Elements: The right prompt (fish_right_prompt.fish) always renders, regardless of C3 state. On failure it shows a red ✘ and the exit code; on success it shows -only the dim timestamp: +only the dim timestamp. When starship is installed and C3 is enabled, the +active Docker context is also shown (if non-default): - ✘ 1 11:39:00 ← failed command - 11:39:00 ← success (no ✘) + ✘ 1 󰡨 myctx Fri Jun 12 00:51:21 2026 ← failed, starship+C3 active + ✘ 1 Fri Jun 12 00:51:21 2026 ← failed, fallback prompt + Fri Jun 12 00:51:21 2026 ← success (no ✘) ### FZF diff --git a/functions/fish_right_prompt.fish b/functions/fish_right_prompt.fish index 0954fd1..9b8c3f0 100644 --- a/functions/fish_right_prompt.fish +++ b/functions/fish_right_prompt.fish @@ -5,10 +5,11 @@ # fish_right_prompt # # DESCRIPTION -# Renders the right-side prompt. Shows a red ✘ with the exit code when the -# last command failed (hidden on success), followed by the current time in -# Catppuccin Overlay0 (dim). Rendered regardless of C3 state so it pairs -# correctly with both the starship and the Catppuccin fallback left prompt. +# Renders the right-side prompt. Always shows a dim timestamp. When the last +# command failed, prefixes it with a red ✘ and the exit code. When starship +# is installed and C3 overrides are enabled, also shows the active Docker +# context (if non-default) — that block is paired with the starship prompt +# which already guards on both conditions. # # RETURNS # 0 Always @@ -25,8 +26,18 @@ function fish_right_prompt set_color normal end + # Docker context — only relevant alongside the starship prompt + if type -q starship; and __fish_config_op_enabled __fish_config_op_overrides + set -l docker_ctx (docker context show 2>/dev/null) + if test -n "$docker_ctx"; and test "$docker_ctx" != default + set_color blue + echo -n "󰡨 $docker_ctx " + set_color normal + end + end + # Timestamp — Catppuccin Overlay0 (dim) set_color '#6c7086' - date +%X + date "+%a %b %d %H:%M:%S %Y" set_color normal end