Text Terminal, Shell, tty, console
Text Terminal: hardware like electronic keyboards and displays, through which the user can interact with a computer.
A terminal emulator,
connected to a virtual terminal, identified by a tty file,
inside which runs a shell.
Terminal Emulator:
tty: is a device file (pseudo device) that represents text terminal. It is used by processes to access text terminal.
Pseudoterminal use PTY “devices” to arrange communication between console applications and the terminal-making program that runs in user space. Examples are X-based terminal emulators and sshd, that allocates a pseudotty for each login session.
Pseudoterminal, pseudotty, or PTY is a pair of pseudo-devices,
1 ) one of which, the slave, emulates a hardware text terminal device,
2 ) the other of which, the master, provides the means by which a terminal emulator process controls the slave.
Terminal Applications: Applications that runs on to of terminal emulator, for example: bash, vim, tmux etc.
- Input: the terminal converts keys into control sequences (e.g. Left →
\e[D). The shell converts control sequences into commands (e.g.\e[D→backward-char). - Output: the shell emits instructions such as “display
foo”, “switch the foreground color to green”, “move the cursor to the next line”, etc. The terminal acts on these instructions. - The prompt is purely a shell concept.
Shell: An application acts as command-line interpreter
Referene :
https://docs.freebsd.org/doc/2.1.7-RELEASE/usr/share/doc/handbook/handbook45.html