Only alias sudo if no systemwide terminfo db for xterm-kitty is found

This commit is contained in:
Kovid Goyal
2023-11-03 12:30:29 +05:30
parent a54586dfa9
commit 2aa37de6ff
3 changed files with 21 additions and 18 deletions

View File

@@ -112,6 +112,7 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after
# for sudo it will be clobbered by us, so only install this if sudo is not already function
if not contains "no-sudo" $_ksi
and test -n "$TERMINFO" -a "file" = (type -t sudo)
and not test -r "/usr/share/terminfo/x/xterm-kitty" -o -r "/usr/share/terminfo/78/xterm-kitty"
# Ensure terminfo is available in sudo
function sudo
set --local is_sudoedit "n"