From 6fe192606a0808eba5e3fbc58989088c0e364584 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Thu, 21 Nov 2024 18:27:10 +0100 Subject: [PATCH] functions/history: Set variables in function-scope explicitly ```fish set -g LESS foo history search bar ``` changes the global $LESS and exports it. --- share/functions/history.fish | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/functions/history.fish b/share/functions/history.fish index df8a1db88..fecb9fec3 100644 --- a/share/functions/history.fish +++ b/share/functions/history.fish @@ -77,14 +77,14 @@ function history --description "display or manipulate interactive command histor # If the user hasn't preconfigured less with the $LESS environment variable, # we do so to have it behave like cat if output fits on one screen. if not set -qx LESS - set -x LESS --quit-if-one-screen + set -fx LESS --quit-if-one-screen # Also set --no-init for less < v530, see #8157. if type -q less; and test (less --version | string match -r 'less (\d+)')[2] -lt 530 2>/dev/null - set -x LESS $LESS --no-init + set LESS $LESS --no-init end end not set -qx LV # ask the pager lv not to strip colors - and set -x LV -c + and set -fx LV -c builtin history search $search_mode $show_time $max_count $_flag_case_sensitive $_flag_reverse $_flag_null -- $argv | $pager else