Sample Header Ad - 728x90

Do programs that create pseudoterminals emulate terminals?

2 votes
1 answer
201 views
The way I understand it, applications that create a pty (a master/slave pair) can be separated into 2 categories: * terminal emulators (xterm, urxvt, ...), which supposedly produce graphical output * the rest (docker, ssh, tmux, screen, ...), which supposedly produce text output Meaning, the former have to more or less draw on a graphical display. The latter, produce text output (optionally with escape sequences) for the former. And what you supposedly get is a chain of terminal emulators (e.g. xterm ssh tmux docker). Where the segments of the chain sort of translate escape sequences from one language to another. Or to be more precise, they process their escape sequences, and use the terminfo database to translate them to the next terminal emulator. The following image from "The TTY demystified" is probably also in order here: ![](https://i.sstatic.net/WnuXc.png) Now, what makes xterm xterm? Is it xterm that processes escape sequences, or it just lets the kernel do the work? In other words, the xterm terminfo database entry... does it correspond to the kernel, or to xterm? Well, putting it this way, the answer seems obvious. Although I still don't know if the kernel somehow affects the terminfo database entries. What about the other programs? Is creating a pty gives you, sort of, a blank terminal that doesn't process escape sequences, and you're responsible for adding that sort of processing? Which means that the escape sequences you process determines the value of the TERM variable on the other end? Anything I'm missing here? The question is inspired by the following answer , where the author claims that the TERM value doesn't matter.
Asked by x-yuri (3603 rep)
Feb 8, 2022, 08:18 AM
Last activity: Mar 5, 2022, 10:59 AM