2007-10-06 20:32:31 +10:00
|
|
|
function __fish_paginate -d "Paginate the current command using the users default pager"
|
|
|
|
|
2016-11-27 21:27:22 -08:00
|
|
|
set -l cmd less
|
|
|
|
if set -q PAGER
|
2019-12-01 11:03:44 +00:00
|
|
|
echo $PAGER | read -at cmd
|
2016-11-27 21:27:22 -08:00
|
|
|
end
|
2007-10-06 20:32:31 +10:00
|
|
|
|
2019-10-01 19:10:01 +02:00
|
|
|
if test -z (commandline -j | string join '')
|
2017-10-25 16:13:42 -07:00
|
|
|
commandline -a $history[1]
|
|
|
|
end
|
|
|
|
|
2016-11-27 21:27:22 -08:00
|
|
|
if commandline -j | string match -q -r -v "$cmd *\$"
|
2010-09-18 10:18:26 +08:00
|
|
|
|
2019-10-29 20:48:10 +01:00
|
|
|
commandline -aj " &| $cmd;"
|
2016-11-27 21:27:22 -08:00
|
|
|
end
|
2007-10-06 20:32:31 +10:00
|
|
|
|
|
|
|
end
|