Handle multiple arguments in $PAGER

$PAGER may contain arguments, and should thus be word-split before 
invocation.
This commit is contained in:
edef
2019-12-01 11:03:44 +00:00
committed by Johannes Altmanninger
parent d91b0f86f4
commit 031d30c8ac
3 changed files with 3 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ function __fish_paginate -d "Paginate the current command using the users defaul
set -l cmd less
if set -q PAGER
set cmd $PAGER
echo $PAGER | read -at cmd
end
if test -z (commandline -j | string join '')

View File

@@ -110,7 +110,7 @@ function __fish_print_help --description "Print help message for the specified f
begin
set -l pager less
set -q PAGER
and set pager $PAGER
and echo $PAGER | read -at pager
not isatty stdout
and set pager cat # cannot use a builtin here
# similar to man, but add -F to quit paging when the help output is brief (#6227)

View File

@@ -86,7 +86,7 @@ function history --description "display or manipulate interactive command histor
if isatty stdout
set -l pager less
set -q PAGER
and set pager $PAGER
and echo $PAGER | read -at pager
# 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. Prevent the