In a diagram from APUE,
Where is a physical terminal device or virtual console for the terminal emulator read and write with?
what process open, read and write with some physical terminal device or virtual console? Is it the terminal emulator?
In a diagram from APUE,
Where is a physical terminal device or virtual console for the terminal emulator read and write with?
what process open, read and write with some physical terminal device or virtual console? Is it the terminal emulator?
See What are the responsibilities of each Pseudo-Terminal (PTY) component (software, master side, slave side)? for lots of useful context.
The point of a terminal emulator is to emulate the physical terminals of old. None of the connections in the APUE diagram correspond to anything physical. When it starts a shell, the terminal emulator opens the PTY master, allocates a PTY slave, sets the appropriate line discipline (if necessary), and exec
s the shell with the corresponding file descriptors as standard input etc. The terminal emulator’s job then consists of emulating the behaviour of a physical terminal, implementing the display (typically using X or Wayland), and the user input (ditto).
init
process with the help of getty
.
– Stephen Kitt
Jun 02 '18 at 13:43
getty
?
– Tim
Jun 02 '18 at 13:51
/dev/ttyX
(for some value of X
), but it doesn’t. And it doesn’t write to the terminal to produce the display output, nor does it receive mice events from it.
– Stephen Kitt
Jun 02 '18 at 15:37
terminal line disipline
boxes in the figure correspond to character device files (e.g.,/dev/pts/7
). I'm not familiar with what thePTY master
is in the figure, or how the the terminal emulator interacts with it. – Andy Dalton Jun 01 '18 at 20:43