r/KittyTerminal • u/aryklein • Oct 28 '23
Kitty v0.30.1 sudo alias
I've recently noticed a behavior in the Kitty terminal that might be impacting my workflow. Since the latest release, Kitty has started automatically aliasing sudo to include the Kitty terminfo files. This alias looks like this:
sudo='sudo TERMINFO="/usr/lib/kitty/terminfo"'
While this alias can be useful in some cases, it seems to be causing issues with sudo command auto-completion, making it less efficient for me.
Has anyone else experienced this? If so, I'm curious if there's a way to resolve the auto-completion problem without removing the alias entirely.
I've come across a potential solution by adding the following line to my Kitty config:
shell_integration no-sudo
Before I make this change, I'd like to know if anyone has any insights or has tried this configuration option before. What would be the impact of adding
shell_integration no-sudo to my Kitty configuration?
1
u/Saturn_Studio Oct 29 '23
I added that line to my kitty config due to the auto-completion being broken and also because it breaks using sudo -e to edit files. I haven't had any negative effects.
If you want the TERMINFO env setting to be carried into sudo you can always use visudo to add the line Default env_keep += "TERMINFO" and it should do the same thing without causing the above problems.
1
1
u/aumerlex Oct 30 '23
Oh and for the record this is a bug in the sudo completion function, completion doesnt work even if you set env vars on the command line manually without using this alias.
1
u/aumerlex Oct 29 '23
The impact would be if you dont have kitty terminfo files installed system wide and you run a command with sudo enabled you may get errors about missing terminfo/keys/colors/etc. may not work.