From fefcb9034b3a71908575198921b415f45408507d Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 00:35:26 -0400 Subject: [PATCH 1/9] feat: add empty fish_mode_prompt stub to suppress vi-mode prefix --- functions/fish_mode_prompt.fish | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 functions/fish_mode_prompt.fish diff --git a/functions/fish_mode_prompt.fish b/functions/fish_mode_prompt.fish new file mode 100644 index 0000000..467ff62 --- /dev/null +++ b/functions/fish_mode_prompt.fish @@ -0,0 +1,16 @@ +# Copyright (C) 2026 Rootiest +# SPDX-License-Identifier: AGPL-3.0-or-later +# +# SYNOPSIS +# fish_mode_prompt +# +# DESCRIPTION +# Empty override. Suppresses fish's built-in vi-mode prefix ([N]/[I]/etc.) +# that would prepend to the prompt line and break the two-line nim layout. +# Vi-mode display is handled inside fish_prompt itself. +# +# EXAMPLE +# # Rendered automatically by fish; not called directly. + +function fish_mode_prompt +end -- 2.52.0 From ab284641a51020eb052763fdfa03be9ac89a16d2 Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 00:36:30 -0400 Subject: [PATCH 2/9] fix: add RETURNS block and remove blank line in fish_mode_prompt docstring --- functions/fish_mode_prompt.fish | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/fish_mode_prompt.fish b/functions/fish_mode_prompt.fish index 467ff62..01065f8 100644 --- a/functions/fish_mode_prompt.fish +++ b/functions/fish_mode_prompt.fish @@ -9,8 +9,10 @@ # that would prepend to the prompt line and break the two-line nim layout. # Vi-mode display is handled inside fish_prompt itself. # +# RETURNS +# 0 Always (function body is empty) +# # EXAMPLE # # Rendered automatically by fish; not called directly. - function fish_mode_prompt end -- 2.52.0 From eb828a09d5df11287d1bde1a4b876a9712c3fe3f Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 00:38:22 -0400 Subject: [PATCH 3/9] feat: add catppuccin nim-style fallback fish_prompt --- functions/fish_prompt.fish | 138 +++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 functions/fish_prompt.fish diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish new file mode 100644 index 0000000..f600a51 --- /dev/null +++ b/functions/fish_prompt.fish @@ -0,0 +1,138 @@ +# Copyright (C) 2026 Rootiest +# SPDX-License-Identifier: AGPL-3.0-or-later +# +# SYNOPSIS +# fish_prompt +# +# DESCRIPTION +# Catppuccin Mocha fallback prompt (nim-style, two-line). Active whenever +# the starship prompt is not available — either starship is not installed or +# C3 overrides are disabled. Has no external dependencies; uses only fish +# builtins (set_color, fish_git_prompt, prompt_pwd, prompt_hostname). +# +# RETURNS +# 0 Always; outputs the prompt to stdout +# +# EXAMPLE +# # Rendered automatically by fish; not called directly. +function fish_prompt + set -l last_status $status + + # Catppuccin Mocha hex palette + set -l c_green a6e3a1 + set -l c_red f38ba8 + set -l c_yellow f9e2af + set -l c_text cdd6f4 + set -l c_blue 89b4fa + set -l c_teal 94e2d5 + set -l c_pink f5c2e7 + set -l c_dim 6c7086 + set -l c_mauve cba6f7 + + # Line/connector color tracks last exit status; brackets stay bold green + set -l retc $c_green + test $last_status -ne 0; and set retc $c_red + + # Enable upstream arrows in git prompt (↑/↓) + set -q __fish_git_prompt_showupstream + or set -g __fish_git_prompt_showupstream auto + + # ─── First line ─────────────────────────────────────────────────────────── + set_color $retc + echo -n '┬─' + set_color --bold $c_green + echo -n '[' + + # Username: red if root, yellow otherwise + if functions -q fish_is_root_user; and fish_is_root_user + set_color --bold $c_red + else + set_color --bold $c_yellow + end + echo -n $USER + + set_color --bold $c_text + echo -n '@' + + # Hostname: teal if SSH, blue if local + if test -n "$SSH_CLIENT" + set_color --bold $c_teal + else + set_color --bold $c_blue + end + echo -n (prompt_hostname) + + set_color --bold $c_text + echo -n ':' + set_color $c_text + echo -n (prompt_pwd) + set_color --bold $c_green + echo -n ']' + set_color normal + + # Vi-mode segment ─[N/I/R/V] + if test "$fish_key_bindings" = fish_vi_key_bindings + or test "$fish_key_bindings" = fish_hybrid_key_bindings + set -l mode_str + switch $fish_bind_mode + case default + set mode_str (set_color --bold $c_red)'N'(set_color normal) + case insert + set mode_str (set_color --bold $c_green)'I'(set_color normal) + case replace_one replace + set mode_str (set_color --bold $c_teal)'R'(set_color normal) + case visual + set mode_str (set_color --bold $c_mauve)'V'(set_color normal) + end + set_color $retc + echo -n '─' + set_color --bold $c_green + echo -n '[' + echo -n $mode_str + set_color --bold $c_green + echo -n ']' + set_color normal + end + + # Virtual environment segment ─[V:name] + set -q VIRTUAL_ENV_DISABLE_PROMPT + or set -g VIRTUAL_ENV_DISABLE_PROMPT true + if set -q VIRTUAL_ENV + set_color $retc + echo -n '─' + set_color --bold $c_green + echo -n '[' + set_color normal + set_color $retc + echo -n 'V:'(path basename "$VIRTUAL_ENV") + set_color --bold $c_green + echo -n ']' + set_color normal + end + + # Git branch in Catppuccin Pink, wrapped in parens: (main) + set -l git_info (fish_git_prompt '%s') + if test -n "$git_info" + echo -n ' ' + set_color $c_pink + echo -n "($git_info)" + set_color normal + end + + echo # newline + + # Background jobs (one per line, dim) + for job in (jobs) + set_color $retc + echo -n '│ ' + set_color $c_dim + echo $job + end + + # ─── Second line ────────────────────────────────────────────────────────── + set_color $retc + echo -n '╰─>' + set_color --bold $c_red + echo -n '$ ' + set_color normal +end -- 2.52.0 From 4c77f3b0af8f69ffd7a6853c1bef678513823821 Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 00:40:51 -0400 Subject: [PATCH 4/9] fix: add operator vi-mode case and # prefix to hex palette in fish_prompt --- functions/fish_prompt.fish | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index f600a51..99bfa25 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -19,15 +19,15 @@ function fish_prompt set -l last_status $status # Catppuccin Mocha hex palette - set -l c_green a6e3a1 - set -l c_red f38ba8 - set -l c_yellow f9e2af - set -l c_text cdd6f4 - set -l c_blue 89b4fa - set -l c_teal 94e2d5 - set -l c_pink f5c2e7 - set -l c_dim 6c7086 - set -l c_mauve cba6f7 + set -l c_green '#a6e3a1' + set -l c_red '#f38ba8' + set -l c_yellow '#f9e2af' + set -l c_text '#cdd6f4' + set -l c_blue '#89b4fa' + set -l c_teal '#94e2d5' + set -l c_pink '#f5c2e7' + set -l c_dim '#6c7086' + set -l c_mauve '#cba6f7' # Line/connector color tracks last exit status; brackets stay bold green set -l retc $c_green @@ -83,6 +83,10 @@ function fish_prompt set mode_str (set_color --bold $c_teal)'R'(set_color normal) case visual set mode_str (set_color --bold $c_mauve)'V'(set_color normal) + case operator + set mode_str (set_color --bold $c_teal)'O'(set_color normal) + case '*' + set mode_str (set_color --bold $c_dim)'?'(set_color normal) end set_color $retc echo -n '─' -- 2.52.0 From b5513ccbde95747ac3769e117d54da59e0dcf2cd Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 00:41:53 -0400 Subject: [PATCH 5/9] =?UTF-8?q?fix:=20overhaul=20fish=5Fright=5Fprompt=20?= =?UTF-8?q?=E2=80=94=20exit=20code,=20dim=20time,=20remove=20docker=20dep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/fish_right_prompt.fish | 36 +++++++++++++++----------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/functions/fish_right_prompt.fish b/functions/fish_right_prompt.fish index df61ec3..4a97692 100644 --- a/functions/fish_right_prompt.fish +++ b/functions/fish_right_prompt.fish @@ -1,34 +1,32 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later - +# # SYNOPSIS # fish_right_prompt # # DESCRIPTION -# Renders the right-side prompt showing the active Docker context (in blue, -# when non-default) and the current timestamp. +# 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. +# +# RETURNS +# 0 Always # # EXAMPLE -# # Rendered automatically by Fish shell; not called directly. +# # Rendered automatically by fish; not called directly. function fish_right_prompt --description 'Execute fish_right_prompt' - # Opinionated guard (C3): no right prompt when overrides are disabled. - __fish_config_op_enabled __fish_config_op_overrides; or return + set -l last_status $status - # 1. Docker Context in Blue - 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 " + # Failed command: red ✘ + exit code; hidden when 0 + if test $last_status -ne 0 + set_color '#f38ba8' + echo -n "✘ $last_status " set_color normal end - # 2. Timestamp Logic with Fallback - set_color brblack - if type -q __bobthefish_timestamp - __bobthefish_timestamp - else - # Manual fallback format: Wed Feb 11 15:04:28 2026 - date "+%a %b %d %H:%M:%S %Y" - end + # Timestamp — Catppuccin Overlay0 (dim) + set_color '#6c7086' + date +%X set_color normal end -- 2.52.0 From 0670fbbdadc28f3dee01e457da864b9795c7844c Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 00:43:42 -0400 Subject: [PATCH 6/9] docs: document catppuccin fallback prompt and update component reference --- docs/fish-config.index | 9 +++++++++ docs/fish-config.md | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/docs/fish-config.index b/docs/fish-config.index index 8cf6510..9e7106d 100644 --- a/docs/fish-config.index +++ b/docs/fish-config.index @@ -191,6 +191,15 @@ logging-sentinel=#### C5 — Logging and Capture c6=#### C6 — Greeting and First-Run UI greeting=#### C6 — Greeting and First-Run UI +# ── Prompt and Theme ────────────────────────────────────────── +prompt-theme=## Prompt and Theme +starship=### Starship +fallback-prompt=### Catppuccin Fallback Prompt +catppuccin-prompt=### Catppuccin Fallback Prompt +nim-prompt=### Catppuccin Fallback Prompt +fzf-theme=### FZF +catppuccin-theme=### Catppuccin Mocha Syntax Highlighting + # ── Section 8: Fisher Plugins ───────────────────────────────── plugins=# 8. FISHER PLUGINS fisher=# 8. FISHER PLUGINS diff --git a/docs/fish-config.md b/docs/fish-config.md index 01b88bf..11ddfd7 100644 --- a/docs/fish-config.md +++ b/docs/fish-config.md @@ -1362,7 +1362,7 @@ fish-deps manages these tools. Run `fish-deps` to check status, or Rust-based tools and to build fish from source. All paths are gated on type -q cargo and degrade gracefully. starship Cross-shell prompt; loaded via type -q starship guard. - Without it fish falls back to its built-in default prompt. + Without it the Catppuccin nim-style fallback prompt activates. uv Python package and project manager (Astral); used by the fish-from-source build path in fish-deps. All consumers degrade gracefully without it. @@ -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: Docker context + timestamp + Right prompt fish_right_prompt: exit code (on failure) + dim timestamp; always rendered The bang-bang system spans key_bindings.fish, abbr.fish, puffer.fish, and six expand_bang_*.fish functions. All are gated together — disabling C3 @@ -1694,6 +1694,34 @@ markers on the prompt line itself. This allows ov to use them as sticky section headers when browsing scrollback logs. Without Starship, fish's built-in prompt handles these markers automatically. +### Catppuccin Fallback Prompt + +When Starship is absent or C3 overrides are disabled, a built-in nim-style +two-line prompt activates from functions/fish_prompt.fish. No external +dependencies — fish builtins only. + +Layout: + + ┬─[user@host:~/path] (main) + ╰─>$ + +Elements: + + user Yellow (Catppuccin Yellow); red if root + @host Blue (local) or Teal (SSH) + ~/path prompt_pwd abbreviation (Catppuccin Text) + (main) Current git branch in Catppuccin Pink; omitted outside repos + ─[V:name] Active Python venv basename; omitted when none + ─[N/I/R/V] Vi-mode indicator when vi bindings are active + ┬─ / ╰─> Connector lines: Catppuccin Green on success, Red on failure + +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: + + ✘ 1 11:39:00 ← failed command + 11:39:00 ← success (no ✘) + ### FZF FZF is themed to Catppuccin Mocha via FZF_DEFAULT_OPTS set in -- 2.52.0 From 7527f01a2b2af88713fa7760620251499b659f60 Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 00:47:27 -0400 Subject: [PATCH 7/9] fix: use jobs -c in background loop, reset color after loop, clean up right_prompt --- functions/fish_prompt.fish | 7 ++++--- functions/fish_right_prompt.fish | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 99bfa25..1a13912 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -7,8 +7,8 @@ # DESCRIPTION # Catppuccin Mocha fallback prompt (nim-style, two-line). Active whenever # the starship prompt is not available — either starship is not installed or -# C3 overrides are disabled. Has no external dependencies; uses only fish -# builtins (set_color, fish_git_prompt, prompt_pwd, prompt_hostname). +# C3 overrides are disabled. Has no external dependencies; uses only fish-provided functions +# (set_color, fish_git_prompt, prompt_pwd, prompt_hostname). # # RETURNS # 0 Always; outputs the prompt to stdout @@ -126,12 +126,13 @@ function fish_prompt echo # newline # Background jobs (one per line, dim) - for job in (jobs) + for job in (jobs -c) set_color $retc echo -n '│ ' set_color $c_dim echo $job end + set_color normal # ─── Second line ────────────────────────────────────────────────────────── set_color $retc diff --git a/functions/fish_right_prompt.fish b/functions/fish_right_prompt.fish index 4a97692..0954fd1 100644 --- a/functions/fish_right_prompt.fish +++ b/functions/fish_right_prompt.fish @@ -15,7 +15,7 @@ # # EXAMPLE # # Rendered automatically by fish; not called directly. -function fish_right_prompt --description 'Execute fish_right_prompt' +function fish_right_prompt set -l last_status $status # Failed command: red ✘ + exit code; hidden when 0 -- 2.52.0 From 16394da0d9298a1cbd72ca12de778e01892909d3 Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 00:49:28 -0400 Subject: [PATCH 8/9] docs: mention catppuccin fallback prompt in README overview --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5683d56..3f61851 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ abbreviation system for keyboard-driven workflows. This config layers on top of the CachyOS base Fish configuration and adds: - **Catppuccin Mocha** theming throughout (prompt, FZF, syntax highlighting) -- **Starship** prompt with VI key bindings +- **Starship** prompt with VI key bindings; Catppuccin Mocha nim-style fallback prompt when Starship is absent or C3 overrides are disabled - **Fisher** plugin manager bootstrapped automatically; manages `sponge` (failed-command history filter); FZF bindings, Catppuccin theme, done, autopair, and puffer-fish are bundled directly with the config as customized versions - **Smart CLI wrappers** that prefer modern tools (`eza`, `bat`, `btop`, `dust`, `prettyping`) with graceful fallbacks - **Auto Python venv** activation on directory change (direnv-aware) -- 2.52.0 From 4f8c45c4ef7ed51c84cbf34ccc3b5b55ed4b03b8 Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 00:51:55 -0400 Subject: [PATCH 9/9] 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 -- 2.52.0