I'm using Linux console for years, but currently started thinking of how it actually works. Typing a
command as a string and pressing
Enter returns its output in the same terminal window.
Opening a new terminal window and executing
tty shows the following result:
$ tty /dev/pts/10
Man page on pty defines that:
A process that expects to be connected to a terminal, can open the slave end of a pseudoterminal and then be driven by a program that has opened the master end. Anything that is written on the master end is provided to the process on the slave end as though it was input typed on a terminal. [...] Conversely, anything that is written to the slave end of the pseudoterminal can be read by the process that is connected to the master end
The actual terminal window is connected to a slave
/dev/pts/10 and all the input I type into the terminal window is written on the slave end and then read on the master end. A process connected to the master end knows what to do with all the strings user type, executes them and write commands results on the master end which are then read on the slave end and displayed in the terminal window.
What is the process connected to the master end which knows how to execute commands which users type as strings?