2007-10-06 18:32:31 +08:00
|
|
|
function __fish_paginate -d "Paginate the current command using the users default pager"
|
|
|
|
|
2016-11-28 13:27:22 +08:00
|
|
|
set -l cmd less
|
|
|
|
if set -q PAGER
|
|
|
|
set cmd $PAGER
|
|
|
|
end
|
2007-10-06 18:32:31 +08:00
|
|
|
|
2019-10-02 01:10:01 +08:00
|
|
|
if test -z (commandline -j | string join '')
|
2017-10-26 07:13:42 +08:00
|
|
|
commandline -a $history[1]
|
|
|
|
end
|
|
|
|
|
2016-11-28 13:27:22 +08:00
|
|
|
if commandline -j | string match -q -r -v "$cmd *\$"
|
2010-09-18 10:18:26 +08:00
|
|
|
|
2018-04-02 04:42:38 +08:00
|
|
|
commandline -aj " 2>&1 | $cmd;"
|
2016-11-28 13:27:22 +08:00
|
|
|
end
|
2007-10-06 18:32:31 +08:00
|
|
|
|
|
|
|
end
|