From fd1ddddbf0bdd56d743508683a7536ff06468229 Mon Sep 17 00:00:00 2001 From: rootiest Date: Wed, 3 Jun 2026 20:43:00 -0400 Subject: [PATCH 1/2] fix(shell): preserve scrollback prompt colors in ov sticky headers Use a per-invocation temp ov config to set SectionLine Background/Foreground to empty strings, preventing ov from overriding the ANSI colors embedded in the starship prompt when it is pinned as a sticky section header. Also adds a second return sentinel inside the interactive block of config.fish to guard against tool-injected init lines that target the inner scope, and updates README accordingly. --- README.md | 2 +- config.fish | 18 +++++++++++++++++- functions/logs.fish | 12 ++++++++---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 284d703..6ada37b 100644 --- a/README.md +++ b/README.md @@ -676,7 +676,7 @@ Then open a new Fish shell — Fisher and all plugins will be installed automati A [chezmoi](https://www.chezmoi.io/) dotfile manager is also configured — secrets are sourced from `~/.config/.user-dots/fish/secrets.fish` and excluded from version control. > [!IMPORTANT] -> `config.fish` ends with a bare `return` statement. This intentionally prevents any lines appended **after** that point from executing. Many tools (starship, zoxide, mise, etc.) offer a setup command that appends an `init | source` line to your `config.fish` — those lines will silently have no effect here. All integrations are managed through `conf.d/` files instead. If you add a new tool and its shell integration appears to do nothing, check whether it appended an init line to the bottom of `config.fish` and create a `conf.d/.fish` file for it instead. +> `config.fish` contains two `return` sentinel guards. One sits at the end of the `if status is-interactive` block and one sits at the very end of the file. Together they prevent any lines appended **after** either point from executing. Many tools (starship, zoxide, mise, etc.) offer a setup command that appends an `init | source` line to your `config.fish` — those lines will silently have no effect here. All integrations are managed through `conf.d/` files instead. If you add a new tool and its shell integration appears to do nothing, check whether it appended an init line to the bottom of `config.fish` and create a `conf.d/.fish` file for it instead. --- ## Personalization diff --git a/config.fish b/config.fish index 2747416..7e51587 100644 --- a/config.fish +++ b/config.fish @@ -194,12 +194,28 @@ if status is-interactive # your main config or secrets files. For example, you might want different PATH additions, # aliases, or environment variables on your work laptop vs. your home desktop. test -f "$dot_fish/local.fish"; and source "$dot_fish/local.fish" + # # ╭──────────────────────────── END OVERRIDES ──────────────────────────╮ # | End of override section. | # ╰──────────────────────────── END OVERRIDES ──────────────────────────╯ + + # ───────────────────────────────────────────────────────────────────────── + # Tools like starship, zoxide, etc. append init lines below this point via their + # setup commands. We manage all integrations through conf.d/ instead, so we + # return here to prevent injected lines from conflicting with that setup. + # + # This catches injections within the interactive block and + # prevents them from conflicting with our conf.d/ setup. + return # <-- Do not remove this line. + # ───────────────────────────────────────────────────────────────────────── end +# ───────────────────────────────────────────────────────────────────────────── # Tools like starship, zoxide, etc. append init lines below this point via their # setup commands. We manage all integrations through conf.d/ instead, so we # return here to prevent injected lines from conflicting with that setup. -return +# +# This catches injections outside the interactive block and +# prevents them from conflicting with our conf.d/ setup. +return # <-- Do not remove this line. +# ───────────────────────────────────────────────────────────────────────────── diff --git a/functions/logs.fish b/functions/logs.fish index 76d4faf..d9e167b 100644 --- a/functions/logs.fish +++ b/functions/logs.fish @@ -153,10 +153,14 @@ function logs --description 'Browse terminal log files interactively with fzf' set paru_flags $paru_flags --section-delimiter $section_regex --section-header -c command ov $paru_flags $file else if string match -qr '^scrollback' $base - # OSC 133;A (prompt start) appears on its own invisible line immediately before - # the rendered prompt. --section-header-num 2 captures both that blank marker - # line and the actual prompt line as the sticky header, making the prompt visible. - command ov --section-delimiter '\x1b\]133;A' --section-header --section-header-num 1 $file + # Write a minimal ov config to a temp file so the section header + # is displayed without ov's default slateblue background, preserving + # the original ANSI colors of the starship prompt. + set -l ov_cfg (mktemp --suffix .yaml) + printf 'Mode:\n scrollback:\n Style:\n SectionLine:\n Background: ""\n Foreground: ""\n' > $ov_cfg + command ov --config $ov_cfg --view-mode scrollback \ + --section-delimiter '\x1b\]133;A' --section-header --section-header-num 1 $file + rm -f $ov_cfg else command ov $file end From 7610a4121d47bafd32cb72e5195925d44888bf80 Mon Sep 17 00:00:00 2001 From: rootiest Date: Wed, 3 Jun 2026 21:11:34 -0400 Subject: [PATCH 2/2] docs(readme): simplify return sentinel callout wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ada37b..25fb07e 100644 --- a/README.md +++ b/README.md @@ -676,7 +676,7 @@ Then open a new Fish shell — Fisher and all plugins will be installed automati A [chezmoi](https://www.chezmoi.io/) dotfile manager is also configured — secrets are sourced from `~/.config/.user-dots/fish/secrets.fish` and excluded from version control. > [!IMPORTANT] -> `config.fish` contains two `return` sentinel guards. One sits at the end of the `if status is-interactive` block and one sits at the very end of the file. Together they prevent any lines appended **after** either point from executing. Many tools (starship, zoxide, mise, etc.) offer a setup command that appends an `init | source` line to your `config.fish` — those lines will silently have no effect here. All integrations are managed through `conf.d/` files instead. If you add a new tool and its shell integration appears to do nothing, check whether it appended an init line to the bottom of `config.fish` and create a `conf.d/.fish` file for it instead. +> `config.fish` ends with a `return` sentinel guard. Any lines appended **after** it by a tool's setup command will silently have no effect. Many tools (starship, zoxide, mise, etc.) offer a setup command that appends an `init | source` line to your `config.fish` — all integrations are managed through `conf.d/` files instead. If you add a new tool and its shell integration appears to do nothing, check whether its setup command appended an init line to the bottom of `config.fish` and create a `conf.d/.fish` file for it instead. --- ## Personalization