Tty (Unix) - Modes

Modes

Terminals can operate in various modes, relating to when they send input typed by the user on the keyboard to the receiving system (whatever that may be):

character mode (a.k.a. character-at-a-time mode)
In this mode, typed input is sent immediately to the receiving system.
line mode (a.k.a. line-at-a-time mode)
In this mode, the terminal provides a local line editing function, and sends an entire input line, after it has been locally edited, when the user presses a return key. A so-called line mode terminal operates solely in this mode.
block mode (a.k.a. screen-at-a-time mode)
In this mode, the terminal provides a local full-screen data function. The user can enter input into multiple fields in a form on the screen (defined to the terminal by the receiving system), moving the cursor around the screen using keys such as Tab ↹ and the arrow keys and performing editing functions locally using insert, delete, ← Backspace and so forth. The terminal sends only the completed form, consisting of all the data entered on the screen, to the receiving system when the user presses an ↵ Enter key.

Note the distinction between the return and the ↵ Enter keys. In some multiple-mode terminals, that can switch between modes, pressing the ↵ Enter key when not in block mode does not do the same thing as pressing the return key. Whilst the return key will cause an input line to be sent to the host in line-at-a-time mode, the ↵ Enter key will rather cause the terminal to transmit the contents of the character row where the cursor is currently positioned to the host, host-issued prompts and all.

Different computer operating systems require different degrees of mode support when terminals are used as computer terminals. The POSIX terminal interface, as provided by Unix and POSIX-compliant operating systems, does not accommodate block-mode terminals at all, and only rarely requires the terminal itself to be in line-at-a-time mode, since the operating system is required to provide canonical input mode, where the terminal device driver in the operating system emulates local echo in the terminal, and performs line editing functions at the host end. Most usually, and especially so that the host system can support non-canonical input mode, terminals for POSIX-compliant systems are always in character-at-a-time mode. In contrast, IBM 3270 terminals connected to MVS systems are always required to be in block mode.

Read more about this topic:  Tty (Unix)

Famous quotes containing the word modes:

    Men and women are brothers and sisters; they are not of different species; and what need be obtained to know both, but to allow for different modes of education, for situation and constitution, or perhaps I should rather say, for habits, whether good or bad.
    Samuel Richardson (1689–1761)

    Sight and all the other senses are only modes of touch.
    Samuel Butler (1835–1902)

    The essence of belief is the establishment of a habit; and different beliefs are distinguished by the different modes of action to which they give rise.
    Charles Sanders Peirce (1839–1914)