fix: append SGR reset to dsuf to prevent background color bleed (#570)

In lib/-ftb-colorize, the color opened in dpre was never closed in dsuf,
causing background colors (e.g. from vivid LS_COLORS themes) to bleed
into the first character of the following entry in the fzf list.

- Symlink branch: append \033[0m after the resolved path in dsuf
- Non-symlink branch: prepend \033[0m to dsuf

Note: the C module (fzf-tab-candidates-generate builtin) already appends
\033[0m to dsuf in fzftab.c:454 so it is unaffected.

Fixes: #563
This commit is contained in:
birkhoff 2026-03-17 12:39:13 +01:00 committed by GitHub
parent d7e0234614
commit 0983009f86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,7 +28,8 @@ if [[ -n $lstat[14] ]]; then
rsv_color=$REPLY
fi
dpre=$'\033[0m\033['$sym_color'm'
dsuf+=$'\033[0m -> \033['$rsv_color'm'$rsv
dsuf+=$'\033[0m -> \033['$rsv_color'm'$rsv$'\033[0m'
else
dpre=$'\033[0m\033['$REPLY'm'
dsuf=$'\033[0m'$dsuf
fi