Terminal emulator

Last updated
xterm, a terminal emulator designed for the X Window System Xterm.png
xterm, a terminal emulator designed for the X Window System
Windows Terminal, an open-source terminal emulator for Windows 10 and Windows 11 Windows Terminal v1.0 1138x624.png
Windows Terminal, an open-source terminal emulator for Windows 10 and Windows 11

A terminal emulator, or terminal application, is a computer program that emulates a video terminal within some other display architecture. Though typically synonymous with a shell or text terminal, the term terminal covers all remote terminals, including graphical interfaces. A terminal emulator inside a graphical user interface is often called a terminal window.

Contents

A terminal window allows the user access to a text terminal and all its applications such as command-line interfaces (CLI) and text user interface (TUI) applications. These may be running either on the same machine or on a different one via telnet, ssh, dial-up, or over a direct serial connection. On Unix-like operating systems, it is common to have one or more terminal windows connected to the local machine.

Terminals usually support a set of escape sequences for controlling color, cursor position, etc. Examples include the family of terminal control sequence standards that includes ECMA-48, ANSI X3.64, and ISO/IEC 6429.

Background

In the early days of computing, with the advent of interactive computing, the prevailing model involved a central computer connected to multiple terminals. [1] This configuration, known as the centralized or mainframe model, featured a powerful central computer that performed all the processing tasks, while terminals served as input/output devices for users to interact with the system. These systems were initially character based.

Character-oriented terminals

A Televideo ASCII character mode terminal Televideo925Terminal.jpg
A Televideo ASCII character mode terminal

A character-oriented terminal is a type of computer terminal that communicates with its host one character at a time, as opposed to a block-oriented terminal that communicates in blocks of data. It is the most common type of data terminal, because it is easy to implement and program. Connection to the mainframe computer or terminal server is achieved via RS-232 serial links, Ethernet or other proprietary protocols.

Character-oriented terminals can be "dumb" or "smart". Dumb terminals [2] are those that can interpret a limited number of control codes (CR, LF, etc.) but do not have the ability to process special escape sequences that perform functions such as clearing a line, clearing the screen, or controlling cursor position. In this context dumb terminals are sometimes dubbed glass Teletypes, for they essentially have the same limited functionality as does a mechanical Teletype. This type of dumb terminal is still supported on modern Unix-like systems by setting the environment variable TERM to dumb. Smart or intelligent terminals are those that also have the ability to process escape sequences, in particular the VT52, VT100 or ANSI escape sequences.

Emulators

When personal computers became ubiquitous in the 1980s, they offered the option of running software on the user's personal computer, providing an opportunity to replace the expensive and space consuming hardware terminals with something that had additional functions. [3] Immediately software became available, that could emulate the functions of the hardware terminals on a PC. Examples of such software for DOS were Telix or Telemate, which was published in 1988 and could emulate a DEC VT102 terminal. [4]

Workstations, usually running versions of Unix, also became common in the 1980s. Unix systems usually provided access to the command line with locally-attached or dial-up terminals. Unix workstations were designed to be used primarily through a graphical user interface (GUI); to provide access to the command line, the GUI included terminal emulator applications that behaved like locally-attached terminals.

During the 1990s, new operating systems like Windows and OS/2 arrived, providing the technical background for more terminal emulators like Telix for Windows, ZOC for OS/2, or PuTTY, which was initially released for Windows in 1998 and which (together with its derivates) is still one a very popular choice to this day. [5]

Through the success of Linux, especially running on data centers and cloud servers, [6] the necessity of accessing remote computers through character based terminals remains. This is evident in the fact, that today lists of terminal emulators that could serve as alternative to the aforementioned PuTTY offers over 100 alternatives. [7] [ dubious discuss ]

Examples of terminals emulated

Many terminal emulators have been developed for physical hardware terminals such as VT52, VT100, VT220, VT320, IBM 3270/8/9/E, IBM 5250, IBM 3179G, Data General D211, Hewlett-Packard HP700/92, Sperry/Unisys 2000-series UTS60, Burroughs/Unisys A-series T27/TD830/ET1100, ADDS ViewPoint, AT386, Siemens Nixdorf (SNI) 97801, Televideo 925, and Wyse 50/60.

Some terminal emulators, such as xterm, implement additional features not present in the emulated terminal. [8]

Additionally, programs have been developed to emulate assorted system console "terminals" such as the Sun workstation console and the Linux console.

Finally, some emulators simply refer to a set of standards, such as the standards for ANSI escape codes.

Such programs are available on many platforms, including DOS, Unix-like systems including Linux and macOS, Windows, and embedded operating systems found in cellphones and industrial hardware.

Implementation details

Unix-like systems

In the past, Unix and Unix-like systems used serial port devices such as RS-232 ports, and provided /dev/* device files for them. [9]

With terminal emulators those device files are emulated by using a pair of pseudoterminal devices. This pair is used to emulate a physical port/connection to the host computing endpoint - computer's hardware provided by operating system APIs, some other software like rlogin, telnet or SSH or else. [10] For example, in Linux systems these would be /dev/ptyp0 (for the master side) and /dev/ttyp0 (for the slave side) pseudoterminal devices respectively.

There are also special virtual console files like /dev/console. In text mode, writing to the file displays text on the virtual console and reading from the file returns text the user writes to the virtual console. As with other text terminals, there are also special escape sequences, control characters and functions that a program can use, most easily via a library such as ncurses . For more complex operations, the programs can use console and terminal special ioctl system calls. One can compare devices using the patterns vcs ("virtual console screen") and vcsa ("virtual console screen with attributes") such as /dev/vcs1 and /dev/vcsa1. [11]

Some terminal emulators also include escape sequences for configuring the behavior of the terminal to facilitate good interoperation between the terminal and programs running inside of it, for example to configure paste bracketing.

The virtual consoles can be configured in the file /etc/inittab read by init —typically it starts the text mode login process getty for several virtual consoles. X Window System can be configured in /etc/inittab or by an X display manager. A number of Linux distributions use systemd instead of init, which also allows virtual console configuration.

CLI tools

Typical Linux system programs used to access the virtual consoles include:

  • chvt to switch the current virtual console
  • openvt to run a program on a new virtual console
  • deallocvt to close a currently unused virtual console

Local echo

Terminal emulators may implement a local echo function, which may erroneously be named "half-duplex", or still slightly incorrectly "echoplex" (which is formally an error detection mechanism rather than an input display option). [12] [13] [14] [15]

Line-at-a-time mode/Local editing

Terminal emulators may implement local editing, also known as "line-at-a-time mode". This is also mistakenly referred to as "half-duplex".[ citation needed ] In this mode, the terminal emulator only sends complete lines of input to the host system. The user enters and edits a line, but it is held locally within the terminal emulator as it is being edited. It is not transmitted until the user signals its completion, usually with the ↵ Enter key on the keyboard or a "send" button of some sort in the user interface. At that point, the entire line is transmitted. Line-at-a-time mode implies local echo, since otherwise the user will not be able to see the line as it is being edited and constructed. [12] [16] However, line-at-a-time mode is independent of echo mode and does not require local echo. When entering a password, for example, line-at-a-time entry with local editing is possible, but local echo is turned off (otherwise the password would be displayed). [17]

The complexities of line-at-a-time mode are exemplified by the line-at-a-time mode option in the telnet protocol. To implement it correctly, the Network Virtual Terminal implementation provided by the terminal emulator program must be capable of recognizing and properly dealing with "interrupt" and "abort" events that arrive in the middle of locally editing a line. [18]

Synchronous terminals

In asynchronous terminals data can flow in any direction at any time. In synchronous terminals a protocol controls who may send data when. IBM 3270-based terminals used with IBM mainframe computers are an example of synchronous terminals. They operate in an essentially "screen-at-a-time" mode (also known as block mode). Users can make numerous changes to a page, before submitting the updated screen to the remote machine as a single action.

Terminal emulators that simulate the 3270 protocol are available for most operating systems, for use both by those administering systems such as the z9, as well as those using the corresponding applications such as CICS.

Other examples of synchronous terminals include the IBM 5250, ICL 7561, Honeywell Bull VIP7800 and Hewlett-Packard 700/92.

Virtual consoles

Virtual consoles, also called virtual terminals, are emulated text terminals, using the keyboard and monitor of a personal computer or workstation. The word "text" is key since virtual consoles are not GUI terminals and they do not run inside a graphical interface. Virtual consoles are found on most Unix-like systems. They are primarily used to access and interact with servers, without using a graphical desktop environment.

See also

Notes

  1. FU Berlin, 3. Minicomputer architecture
  2. "What is dumb terminal? definition and meaning". BusinessDictionary.com. Archived from the original on August 13, 2020. Retrieved March 13, 2019.
  3. "Emulating a Terminal on Personal Computers".
  4. "Telemate Wiki".
  5. "SSH Clients for Windows".
  6. "Powering Linux in the Data-Center".[ dead link ]
  7. "Alternatives to Putty".
  8. Thomas E. Dickey. "XTerm - Frequently Asked Questions (FAQ)". Why a VT220?.
  9. "A Brief History of Terminal Emulation | Turbosoft". www.ttwin.com. Retrieved 2021-10-04.
  10. "Ubuntu Manpage: tty — general terminal interface". manpages.ubuntu.com. Retrieved 2021-10-04.
  11. "Screen dumps". The Linux keyboard and console HOWTO. The Linux Documentation Project . Retrieved 2008-07-31. The current contents of the screen of /dev/ttyN can be accessed using the device /dev/vcsN (where `vcs' stands for `virtual console screen'). [...] From a program it is usually better to use /dev/vcsaN (`virtual console screen with attributes') instead - it starts with a header giving the number of rows and columns and the location of the cursor. See vcs(4).
  12. 1 2 Daintith 2004, p. 171.
  13. Weik 2000, "echo" p. 478.
  14. Weik 2000, "echoplex" p. 479.
  15. Weik 2000, "echoplex mode" p. 479.
  16. Bangia 2010, p. 324.
  17. Stevens & Wright 1994, p. 413.
  18. Miller 2009, p. 590, 591.

Related Research Articles

<span class="mw-page-title-main">Cygwin</span> Unix-like environment for Windows

Cygwin is a free and open-source Unix-like environment and command-line interface (CLI) for Microsoft Windows. The project also provides a software repository containing many open-source packages. Cygwin allows source code for Unix-like operating systems to be compiled and run on Windows. Cygwin provides native integration of Windows-based applications.

<span class="mw-page-title-main">Graphical user interface</span> User interface allowing interaction through graphical icons and visual indicators

A graphical user interface, or GUI, is a form of user interface that allows users to interact with electronic devices through graphical icons and visual indicators such as secondary notation. In many applications, GUIs are used instead of text-based UIs, which are based on typed command labels or text navigation. GUIs were introduced in reaction to the perceived steep learning curve of command-line interfaces (CLIs), which require commands to be typed on a computer keyboard.

<span class="mw-page-title-main">History of the graphical user interface</span>

The history of the graphical user interface, understood as the use of graphic icons and a pointing device to control a computer, covers a five-decade span of incremental refinements, built on some constant core principles. Several vendors have created their own windowing systems based on independent code, but with basic elements in common that define the WIMP "window, icon, menu and pointing device" paradigm.

<span class="mw-page-title-main">Scroll Lock</span> Computer key

Scroll Lock is a lock key on most IBM-compatible computer keyboards. Depending on the operating system, it may be used for different purposes, and applications may assign functions to the key or change their behavior depending on its toggling state. The key is not frequently used, and therefore some reduced or specialized keyboards lack Scroll Lock altogether.

<span class="mw-page-title-main">History of operating systems</span> Aspect of computing history

Computer operating systems (OSes) provide a set of functions needed and used by most application programs on a computer, and the links needed to control and synchronize computer hardware. On the first computers, with no operating system, every program needed the full hardware specification to run correctly and perform standard tasks, and its own drivers for peripheral devices like printers and punched paper card readers. The growing complexity of hardware and application programs eventually made operating systems a necessity for everyday use.

<span class="mw-page-title-main">Computer terminal</span> Computer input/output device for users

A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. Most early computers only had a front panel to input or display bits and had to be connected to a terminal to print or input text through a keyboard. Teleprinters were used as early-day hard-copy terminals and predated the use of a computer screen by decades. The computer would typically transmit a line of data which would be printed on paper, and accept a line of data from a keyboard over a serial or other interface. Starting in the mid-1970s with microcomputers such as the Sphere 1, Sol-20, and Apple I, display circuitry and keyboards began to be integrated into personal and workstation computer systems, with the computer handling character generation and outputting to a CRT display such as a computer monitor or, sometimes, a consumer TV, but most larger computers continued to require terminals.

<span class="mw-page-title-main">Text-based user interface</span> Type of interface based on outputting to or controlling a text display

In computing, text-based user interfaces (TUI), is a retronym describing a type of user interface (UI) common as an early form of human–computer interaction, before the advent of bitmapped displays and modern conventional graphical user interfaces (GUIs). Like modern GUIs, they can use the entire screen area and may accept mouse and other inputs. They may also use color and often structure the display using box-drawing characters such as ┌ and ╣. The modern context of use is usually a terminal emulator.

Text mode is a computer display mode in which content is internally represented on a computer screen in terms of characters rather than individual pixels. Typically, the screen consists of a uniform rectangular grid of character cells, each of which contains one of the characters of a character set; at the same time, contrasted to graphics mode or other kinds of computer graphics modes.

<span class="mw-page-title-main">Pseudoterminal</span> Pair of pseudo-device endpoints

In some operating systems, including Unix-like systems, a pseudoterminal, pseudotty, or PTY is a pair of pseudo-device endpoints (files) which establish asynchronous, bidirectional communication (IPC) channel between two or more processes.

<span class="mw-page-title-main">Virtual console</span> Computer user interface

A virtual console (VC) – also known as a virtual terminal (VT) – is a conceptual combination of the keyboard and display for a computer user interface. It is a feature of some Unix-like operating systems such as Linux, BSD, illumos, UnixWare, and macOS in which the system console of the computer can be used to switch between multiple virtual consoles to access unrelated user interfaces. Virtual consoles date back at least to Xenix and Concurrent CP/M in the 1980s.

A console application or command-line program is a computer program designed to be used via a text-only user interface, such as a text terminal, the command-line interface of some operating systems or the text-based interface included with most graphical user interface (GUI) operating systems, such as the Windows Console in Microsoft Windows, the Terminal in macOS, and xterm in Unix.

In telecommunications, echo is the local display of data, either initially as it is locally sourced and sent, or finally as a copy of it is received back from a remote destination. Local echo is where the local sending equipment displays the outgoing sent data. Remote echo is where the display is a return copy of data as received remotely. Both are used together in a computed form of error detection to ensure that data received at the remote destination of a telecommunication are the same as data sent from the local source. When (two) modems communicate in echoplex mode the remote modem echoes whatever it receives from the local modem.

In Unix-like operating systems, a device file, device node, or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These special files allow an application program to interact with a device by using its device driver via standard input/output system calls. Using standard system calls simplifies many programming tasks, and leads to consistent user-space I/O mechanisms regardless of device features and functions.

A headless computer is a computer system or device that has been configured to operate without a monitor, keyboard, and mouse. A headless system is typically controlled over a network connection, although some headless system devices require a serial connection to be made over RS-232 for administration of the device. Headless operation of a server is typically employed to reduce operating costs.

<span class="mw-page-title-main">Linux console</span> Console of the Linux kernel

The Linux console is a system console internal to the Linux kernel. A system console is the device which receives all kernel messages and warnings and which allows logins in single user mode. The Linux console provides a way for the kernel and other processes to send text output to the user, and to receive text input from the user. The user typically enters text with a computer keyboard and reads the output text on a computer monitor. The Linux kernel supports virtual consoles – consoles that are logically separate, but which access the same physical keyboard and display. The Linux console are implemented by the VT subsystem of the Linux kernel, and do not rely on any user space software. This is in contrast to a terminal emulator, which is a user space process that emulates a terminal, and is typically used in a graphical display environment.

<span class="mw-page-title-main">Command-line interface</span> Computer interface that uses text

A command-line interface (CLI) is a means of interacting with a computer program by inputting lines of text called command-lines. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternative to the non-interactive interface available with punched cards.

The POSIX terminal interface is the generalized abstraction, comprising both an application programming interface for programs, and a set of behavioural expectations for users of a terminal, as defined by the POSIX standard and the Single Unix Specification. It is a historical development from the terminal interfaces of BSD version 4 and Seventh Edition Unix.

A terminal multiplexer is a software application that can be used to multiplex several separate pseudoterminal-based login sessions inside a single terminal display, terminal emulator window, PC/workstation system console, or remote login session, or to detach and reattach sessions from a terminal. It is useful for dealing with multiple programs from a command line interface, and for separating programs from the session of the Unix shell that started the program, particularly so a remote process continues running even when the user is disconnected.

devpts

devpts is a virtual filesystem directory available in the Linux kernel since version 2.1.93. It is normally mounted at /dev/pts and contains solely devices files which represent slaves to the multiplexing master located at /dev/ptmx which in turn is used to implement terminal emulators.

Comparison of user features of operating systems refers to a comparison of the general user features of major operating systems in a narrative format. It does not encompass a full exhaustive comparison or description of all technical details of all operating systems. It is a comparison of basic roles and the most prominent features. It also includes the most important features of the operating system's origins, historical development, and role.

References