@b0rk @njvack I think "man termios" may be a good starting point. This documents the ioctl interface of the line discipline of the tty driver, which is what the tty utility uses to do its magic. It is mostly based on the POSIX standard, with some Linux extensions. Key point is that the driver can operate in different modes. Older commands run in cooked mode where the tty driver does very basic command line editing. Bash, pico, vim, etc use raw mode and handle everything themselves.