mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 01:17:45 +00:00
031d30c8ac
$PAGER may contain arguments, and should thus be word-split before invocation.
17 lines
374 B
Fish
17 lines
374 B
Fish
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 -a $history[1]
|
|
end
|
|
|
|
if commandline -j | string match -q -r -v "$cmd *\$"
|
|
|
|
commandline -aj " &| $cmd;"
|
|
end
|
|
|
|
end
|