mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
sudo keywork is ignored when alt+h is pressed
if `sudo` is in the beggining of the command string, then at alt+h press the manual of the following command is shown instead. Fixes https://github.com/fish-shell/fish-shell/issues/5982
This commit is contained in:
parent
26adff3378
commit
e44d207d64
1 changed files with 6 additions and 0 deletions
|
@ -8,6 +8,12 @@ function __fish_man_page
|
|||
return
|
||||
end
|
||||
|
||||
#Skip `sudo` and display then manpage of following command
|
||||
while set -q args[2]
|
||||
and test $args[1] = "sudo"
|
||||
set args $args[2..-1]
|
||||
end
|
||||
|
||||
# If there are at least two tokens not starting with "-", the second one might be a subcommand.
|
||||
# Try "man first-second" and fall back to "man first" if that doesn't work out.
|
||||
set -l maincmd (basename $args[1])
|
||||
|
|
Loading…
Reference in a new issue