thestinger / termite

Termite is obsoleted by Alacritty. Termite was a keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.
https://github.com/alacritty/alacritty
2.74k stars 241 forks source link

Terminal colors disappears on SSH connection #693

Closed soullivaneuh closed 3 years ago

soullivaneuh commented 5 years ago

Screenshot_2019-07-30_18-07-12

I tried with xterm, working.

I tried other ssh servers, same issue.

mymedia2 commented 5 years ago

To fix this issue, install terminfo database on the remote machine.

wget https://raw.githubusercontent.com/thestinger/termite/master/termite.terminfo
tic -x termite.terminfo

https://github.com/thestinger/termite#terminfo

soullivaneuh commented 5 years ago

This is not a issue fix to me, nearly a workaround.

First, it means you have to install something on each server you use. This is cumbersome especially when you know any other emulator does not needs extra install to work. I work on a hosting company, logging on many servers, I can't install it on each of them.

Second, I don't have enough permission to install anything on some servers, so it is blocking.

The colors are not supposed to be managed on a remote service, but by the terminal emulator itself.

Plus, I don't have the referenced error from the doc:

Error opening terminal: xterm-termite
mymedia2 commented 5 years ago

This is cumbersome especially when you know any other emulator does not needs extra install to work.

Other emulators already have descriptions in the terminfo database provided by ncurses library. Some of them mimic xterm-256color, termite does not do that.

Second, I don't have enough permission to install anything on some servers, so it is blocking.

You can install the database as a normal unprivileged user.

But by default it's placed in system-wide directories /lib/terminfo and /usr/share/terminfo.

https://packages.ubuntu.com/devel/all/ncurses-base/filelist https://packages.ubuntu.com/devel/all/ncurses-term/filelist

BarbUk commented 5 years ago

I work on a hosting company, logging on many servers, I can't install it on each of them.

An easy fix if you can't deploy the terminfo is to change your local TERM environnement. Add in your bashrc

export TERM=xterm-color
egmontkob commented 5 years ago

Some of them mimic xterm-256color, termite does not do that.

Termite uses the VTE widget for terminal emulation (more precisely: a fork thereof, however, the changes made from mainstream VTE are not related to the actual emulation behavior and hence are irrelevant here).

VTE sets TERM=xterm-256color by default. Its developers put a lot of effort into making sure that VTE's behavior is reasonably compatible with xterm, and this is the TERM value they keep testing VTE with. Also, this is the TERM value the vast majority of VTE users test VTE with and report bugs, since most VTE-based emulators leave this setting at xterm-256color. Piggybacking the description of another emulator has its cons and pros; the cons including any problem arising from actual differences from xterm's, and the pros including the terminfo definition being available across ssh.

Termite, which did not change anything in VTE's terminal emulation behavior, decided to override VTE's decision and go for the other approach with different set of pros and cons, including this very problem we see in this bugreport. I'm not convinced this was a great move from Termite, but YMMV.

ifohancroft commented 4 years ago

Maybe we should submit xterm-termite to ncurses's terminal database? I think this is the one and only appropriate way to solve this?

dtzWill commented 4 years ago

ncurses already has info for termite, but under the name termite and not xterm-termite since there's nothing xterm about termite (although some programs match the xterm prefix and alter their behavior, IIRC vim does this). The entry for termite is significantly different than that provided in-tree, I think neither is perfect for modern termite. I'll add a detail not usually mentioned: ncurses also has terminfo entries for vte (and variants, see the ncurses terminfo database docs for details and listing) which might be ideal for termite usage as it seems to be updated regularly (there's a vte2018 entry for example) by ncurses folks. I'm not sure how to square the differences between vte terminfo specified by ncurses and vte seeming to prefer xterm-256color as detailed above. I believe that vte and xterm are different in important ways (that aren't bugs but intentional), but I can't remember specific examples offhand. vte bug tracker is good for finding discussion of known differences.

Honestly it's unfortunate that there's not a canonical maintained terminfo for vte (and as a result, for termite). Establishing a canonical terminfo seems important before tackling how to ensure it's available in ncurses and eventually elsewhere (not a quick process but not sure much to be done about that).

I suppose the terminfo termite provides is most canonical but I was under the impression ncurses folks found it lacking/incorrect in some way which is why they did things differently (as of a few years ago?). Anyone know what the status of this is currently?

thestinger commented 3 years ago

Termite is obsolete. Please use Alacritty instead. See https://github.com/thestinger/termite#termite-is-obsoleted-by-alacritty for more details.