Open Voklen opened 9 months ago
First of all, I think on login, there should be a warning that no matching terminal definition has been found, isn't it? It should even automatically set the TERM
variable to xterm
, working around the issue. Or do you use another shell than bash
?
However, best is anyway to install native xterm-kitty
support. Two options:
apt install kitty-terminfo
. I'd be actually interested whether this works well, as we might want to add/offer this automatically on SSH login via kitty terminal. It is not necessarily the most recent definition, so if there are significant changes, it might not support all new features of the terminal.EDIT: Ah, now I see the issue, as you did use the +kitty
flag already. It installs the terminal for the login user only (sure, as it has no permissions to do any different), while dietpi-update
runs via sudo as root. Please move the definition to a global place:
sudo mkdir -p /etc/terminfo/x
sudo mv ~/.terminfo/x/xterm-kitty /etc/terminfo/x/
Ahhh that's interesting and explains why the normal way with +kitty
didn't work but installing kitty-terminfo
did indeed fix the issue. Thank you very much for the quick response.
As you are not the first running into this, let me reopen and think about how we can solve this a clever way automatically with our login scripts.
There is the option of modifying visudo
to preserve TERMINFO
with
Defaults env_keep += "TERM TERMINFO"
It is preserved, which is the problem, as root
does not have this definition in its home dir. It could be explicitly reset/set to xterm
, but then the nice kitty terminal features are lost.
If kitty +kitty ssh
does not only install but also update the users' terminal definition, I though about a symlink, to have the global one kept in sync:
sudo ls -s "$HOME/.terminfo/x/xterm-kitty" /etc/terminfo/x/xterm-kitty
But I guess every other non-root user would then run into errors, as /<other users' home>/.terminfo/x/xterm-kitty
is within a directory they have no read access to. Copying/moving it over means that it won't be updated. Via apt
it will get bug fixes and security patches, if needed, from Debian, but feature-wise can be up to 2 years behind. 🤔
Required Information
bookworm 1
Linux rpi-uk 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux
RPi B (armv6l)
Steps to reproduce
kitty +kitten ssh <user>@<ip>
sudo dietpi-update
Expected behaviour
Actual behaviour
Extra details
I noticed this when I was updating DietPi, so I tried to set
export TERM='dumb'
but then it didn't come up with the updating UI so I had to get the keyboard out, plug it into a monitor and update it from there. This issue potentially has some relation to #5347, runningstill gives