mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 09:27:38 +00:00
9 lines
263 B
Fish
9 lines
263 B
Fish
|
function __fish_prepend_sudo -d "Prepend 'sudo ' to the beginning of the current commandline"
|
||
|
set -l cmd (commandline -boc)
|
||
|
if test "$cmd[1]" != "sudo"
|
||
|
commandline -C 0
|
||
|
commandline -i "sudo "
|
||
|
commandline -f end-of-line
|
||
|
end
|
||
|
end
|