mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-01 07:38:46 +00:00
17 lines
362 B
Fish
17 lines
362 B
Fish
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 | string join '')
|
|
commandline -a $history[1]
|
|
end
|
|
|
|
if commandline -j | string match -q -r -v "$cmd *\$"
|
|
|
|
commandline -aj " &| $cmd;"
|
|
end
|
|
|
|
end
|