mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
functions/history: Set variables in function-scope explicitly
```fish set -g LESS foo history search bar ``` changes the global $LESS and exports it.
This commit is contained in:
parent
11f11e27a1
commit
6fe192606a
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue