From dea72834ed35b5d56634075fc7793aa4b9b1d697 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 7 Jun 2026 18:05:59 +0900 Subject: [PATCH] Keep base fg/bg when resolving colors in bw theme Trailing prompt space and other base-colored segments no longer reset to terminal default --- src/result.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/result.go b/src/result.go index 433f5750..77db9397 100644 --- a/src/result.go +++ b/src/result.go @@ -198,7 +198,10 @@ func (result *Result) colorOffsets(matchOffsets []Offset, nthOffsets []Offset, t start := 0 ansiToColorPair := func(ansi ansiOffset, base tui.ColorPair) tui.ColorPair { if !theme.Colored { - return tui.NewColorPair(-1, -1, ansi.color.attr).MergeAttr(base) + // Ignore ANSI colors but keep the attributes. Retain the base + // colors (e.g. an overridden input-bg or list-bg) instead of + // resetting to the terminal default. + return tui.NewColorPair(base.Fg(), base.Bg(), ansi.color.attr).MergeAttr(base) } // fd --color always | fzf --ansi --delimiter / --nth -1 --color fg:dim:strip,nth:regular if base.ShouldStripColors() {