fish-shell/share/functions/__fish_paginate.fish

18 lines
348 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
set cmd $PAGER
end
if test -z (commandline -j)
commandline -a $history[1]
end
if commandline -j | string match -q -r -v "$cmd *\$"
2010-09-18 10:18:26 +08:00
commandline -aj " ^&1 | $cmd;"
end
end