I am trying to understand Linux' terminal subsystem, especially the tty drivers and line discipline. Apparently, the architecture of this subsystem stems from a time where teletypewriters (ttys) were connected to a computer to input data into the computer and get a process' response.
I have never worked on a real historical tty and I believe that when I understand how such a tty worked I am better able to understand the intrinsics of a tty driver.
I am particularly interested in echoing and line editing.
So, when the operator on the tty would type the text: was the text echoed on the tty (by printing a line on the paper)? Is it echoed while he typed the individual keys/characters or only when he pressed the new line/enter key.
Are the keys (characters) that he types immediatly delivered to the computer (line discipline?) or are they stored in a buffer local to the tty and delivered when the new line key is pressed.
How did an operator edit wrong text (backspace, ctrl-h)? Would the backspace information be sent to the computer where the line would be accordingly edited or was that a feature of the tty (withcut the computer noticing it)?
And finally, what happened if the operator typed in text while the tty was receiving data from the computer?