mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +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 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
|
||||
if status --is-interactive
|
||||
builtin history | eval $pager
|
||||
else
|
||||
builtin history
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue