fix(colorize): pass ZSH_COLORIZE_CHROMA_FORMATTER to cless function

The cless function did not forward the ZSH_COLORIZE_CHROMA_FORMATTER
environment variable to the colorize_cat preprocessor, causing colors
to render incorrectly on 256-color terminals when using chroma as the
syntax highlighter. ccat worked correctly because it passed the variable
directly.

Fixes #12650
This commit is contained in:
Ininsico 2026-05-29 12:16:58 +05:00
parent 080c66d460
commit 691fdc7c46

View File

@ -90,6 +90,7 @@ colorize_less() {
# (e.g. when not scrolled to the bottom) while already the next file will be displayed.
local LESSOPEN="| zsh -c 'source \"$ZSH_COLORIZE_PLUGIN_PATH\"; \
ZSH_COLORIZE_TOOL=$ZSH_COLORIZE_TOOL ZSH_COLORIZE_STYLE=$ZSH_COLORIZE_STYLE \
ZSH_COLORIZE_CHROMA_FORMATTER=$ZSH_COLORIZE_CHROMA_FORMATTER \
colorize_cat %s 2> /dev/null'"
# LESSCLOSE will be set to prevent any errors by executing a user script