I’ve been running into problems with terminfo descriptions not existing on machines I’m SSH’ing to. Example: My laptop has TERM=tmux-256color but a RHEL6 box I connect to does not; I have to choose a lesser term (e.g. screen-256color) or manually do `infocmp -x` (local) and `tic -x` (remote) to fix it. Is there a reason that SSH client couldn’t do something like this? Any “no” will abort these steps and continue with a normal session. 1. Do you support terminfo/ncurses? 2. Are you missing TERM=$TERM? 3. Here is the terminfo description for $TERM. On the server side, it could have builtin support to do `tic -x`. It should force it to write to the terminfo database in the users home directory (even if root!). Alternatively to prevent terminal collisions, it could store the terminfo database in a private temporary directory, set the TERMINFO variable to point at that directory, and remove the private temporary directory when the SSH session closes. Or maybe it could save it as something like SSH-<session-id>-$TERM and force the TERM to that and remove that entry when the session is over. This would be a huge usability win for people who have to deal with various platforms and versions. Ciao!
I don't know whether terminal definitions are guaranteed to be exportable/importable between systems. In practice they work between systems that use ncurses, but that's not a sure thing.
> I don't know whether terminal definitions are guaranteed to be exportable/importable between systems. terminfo is by design compatible between any system (that uses terminfo). > In practice they work between systems that use ncurses, but that's not a sure thing. During compilation if you detect terminfo, then turn on sending or receiving terminfo capabilities. During connection negotiation, the client can ask the remote server if they support terminfo; if true, then send the terminfo capabilities. Assuming a TTY is allocated, the server can write the capabilities to a file and set the TERMINFO environment variable pointing at that file. Also, just to be clear, terminfo is used by ncurses, but (in theory) it is separate. In practice it usually isn't.
Sorry, but I think that this would be significantly complex and relatively fragile. Too much so for the small benefit it IMO provides.
closing resolved bugs as of 8.6p1 release