Merge pull request 'fix(shell): preserve scrollback prompt colors in ov sticky headers' (#27) from feat/preserve-scrollback-header-colors into main
Reviewed-on: #27
This commit was merged in pull request #27.
This commit is contained in:
@@ -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/<tool>.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/<tool>.fish` file for it instead.
|
||||
|
||||
---
|
||||
## Personalization
|
||||
|
||||
+17
-1
@@ -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.
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
+8
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user