fish-shell/share/functions/__fish_paginate.fish

17 lines
374 B
Fish
Raw Normal View History

function __fish_paginate -d "Paginate the current command using the users default pager"
set -l cmd less
if set -q PAGER
echo $PAGER | read -at cmd
end
if test -z (commandline -j | string join '')
commandline -i $history[1]
end
if commandline -j | not string match -q -r "$cmd *\$"
2019-10-30 03:48:10 +08:00
commandline -aj " &| $cmd;"
end
end