I'm trying to understand this topic but, apparently, for my brain it is too hard.
Terminal device entries normally reside in two directories: /dev and /dev/pts. The /dev directory contains entries for virtual consoles (e.g., /dev/tty1) and BSD pseudoterminals. The /dev/pts directory contains entries for (System V style) pseudoterminal slave devices
This is extracted from the "Linux program interface" book.
According to the assertion above, in the /dev/pts
directory i can find the slave part of a Pseudo Terminal.
Then why if i use the tty
command it prints /dev/pts/0
? Is the assertion above incomplete? I mean, is there a relationship between terminal and Pseudo Terminal?
Because if in /dev/pts
i can only find salve parts of pseudo terminal pair, is the terminal implemented like a Pseudo Terminal?
Always from the "Linux program iterface" book:
In a normal login session, the shell is connected directly to the user’s terminal.
So i can make a scheme according to this assertion:
But if my terminal is associated with a slave device (like tty command says), the scheme is not true at all and it becommes:
After this considerations, is the terminal implemented like a Pseudo Terminal pair (with slave and master) or it is just implemented like a slave file (or something like that)?