fish integration: Dont clobber user defined sudo function

This commit is contained in:
Kovid Goyal 2023-10-31 16:49:15 +05:30
parent f3ece8b7c4
commit 7e1580ef09
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -108,9 +108,10 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after
__update_cwd_osc
end
if not contains "no-sudo" $_ksi and test -n "$TERMINFO"
# Note that neither alias nor function is recursive in fish so if the user defines an alias/function
# for sudo it will clobber us
# Note that neither alias nor function is recursive in fish so if the user defines an alias/function
# for sudo it will be clobbered by us, so only install this is sudo is not already function
if not contains "no-sudo" $_ksi
and test -n "$TERMINFO" -a "file" = (type -t sudo)
# Ensure terminfo is available in sudo
function sudo
set --local is_sudoedit "n"