mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 01:48:08 +08:00
history: put the output through the pager in interactive mode
(Ideally, the behaviour of git could be implemented: pipe the input through a pager iff the length is > window size and in interactive mode). Closes #1076.
This commit is contained in:
parent
c84cdcd00c
commit
a580d04dbc
@ -12,6 +12,11 @@ function history --description "Deletes an item from history"
|
||||
|
||||
set -l search_mode none
|
||||
|
||||
set -l pager less
|
||||
if set -q PAGER
|
||||
set pager $PAGER
|
||||
end
|
||||
|
||||
if test $argc -gt 0
|
||||
for i in (seq $argc)
|
||||
switch $argv[$i]
|
||||
@ -33,7 +38,11 @@ function history --description "Deletes an item from history"
|
||||
end
|
||||
else
|
||||
#Execute history builtin without any argument
|
||||
builtin history
|
||||
if status --is-interactive
|
||||
builtin history | eval $pager
|
||||
else
|
||||
builtin history
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user