Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] vi weird when I ssh to one machine



On Sat, 6 Feb 2021, at 09:28, Stephen J. Turnbull wrote:
> Of course, then the question is where TERM gets set.  I don't
> understand why a terminal would work with local output, but not with
> output forwarded by SSH.

It is not only important where TERM gets set, but the important thing is that the termcap description file for whatever value TERM has is present both on the remote server and the client for things to work out correctly. This is another thing to check, because curses and similar libraries will output escape sequences based on the termcap description only. When the remote emits an escape sequence based on its termcap, it gets sent over the wire as-is and if the client doesn't know what's going on, it'll turn out funny. Similarly, when the client emits escape sequences for example pressing the direction keys or key chords according to its TERM/termcap and sends it over the wire as-is, the remote will have a hard time interpreting the escapes unless the TERM/termcap of the remote program can handle what comes over the wire.

Terminals like kitty ship with quality of life improvements who can do the work for you when it comes to ensuring this kind of thing [1].

---
[1] https://sw.kovidgoyal.net/kitty/faq.html#i-get-errors-about-the-terminal-being-unknown-or-opening-the-terminal-failing-when-sshing-into-a-different-computer


Home | Main Index | Thread Index