mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 09:27:38 +00:00
6ec0b583f5
When pressing \ep on an empty commandline, the cursor would stay at the beginning of the commandline. Move it to the end of the previous command, this feels a bit more natural.
16 lines
374 B
Fish
16 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 -i $history[1]
|
|
end
|
|
|
|
if commandline -j | not string match -q -r "$cmd *\$"
|
|
commandline -aj " &| $cmd;"
|
|
end
|
|
|
|
end
|