From cbd5d7640ae2b443b5940949892fd345ee32facb Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Thu, 5 Mar 2026 19:51:58 +0100 Subject: [PATCH] functions/history: honor explicitly specified --color= This partially reverts 324223ddfffa4c1012256470ee3bb365c5ad4a9b. The offending commit broke the ability to set color mode via option completely in interactive sessions. Closes #12511 --- share/functions/history.fish | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/functions/history.fish b/share/functions/history.fish index ffe6e2885..92462c511 100644 --- a/share/functions/history.fish +++ b/share/functions/history.fish @@ -90,7 +90,11 @@ function history --description "display or manipulate interactive command histor not set -qx LV # ask the pager lv not to strip colors and set -fx LV -c - builtin history search --color=always $search_mode $show_time $max_count $_flag_case_sensitive $_flag_reverse $_flag_null -- $argv | $pager + if not set -q color_opt[1] + set color_opt --color=always + end + + builtin history search $color_opt $search_mode $show_time $max_count $_flag_case_sensitive $_flag_reverse $_flag_null -- $argv | $pager else builtin history search $color_opt $search_mode $show_time $max_count $_flag_case_sensitive $_flag_reverse $_flag_null -- $argv end