mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00: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
1 changed files with 10 additions and 1 deletions
|
@ -12,6 +12,11 @@ function history --description "Deletes an item from history"
|
||||||
|
|
||||||
set -l search_mode none
|
set -l search_mode none
|
||||||
|
|
||||||
|
set -l pager less
|
||||||
|
if set -q PAGER
|
||||||
|
set pager $PAGER
|
||||||
|
end
|
||||||
|
|
||||||
if test $argc -gt 0
|
if test $argc -gt 0
|
||||||
for i in (seq $argc)
|
for i in (seq $argc)
|
||||||
switch $argv[$i]
|
switch $argv[$i]
|
||||||
|
@ -33,7 +38,11 @@ function history --description "Deletes an item from history"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
#Execute history builtin without any argument
|
#Execute history builtin without any argument
|
||||||
builtin history
|
if status --is-interactive
|
||||||
|
builtin history | eval $pager
|
||||||
|
else
|
||||||
|
builtin history
|
||||||
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue