Terminal emulator

From HandWiki
Revision as of 20:33, 6 February 2024 by Nautica (talk | contribs) (link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Program that emulates a video terminal
xterm, a terminal emulator designed for the X Window System
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.

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 known as ECMA-48, ANSI X3.64 or ISO/IEC 6429.

History

Computer terminals

IBM 2250 Model 4, including light pen and programmed function keyboard
An "intelligent" terminal[1] does its own processing, usually implying a microprocessor is built in, but not all terminals with microprocessors did any real processing of input: the main computer to which it was attached would have to respond quickly to each keystroke. The term "intelligent" in this context dates from 1969.[2]

Notable examples include the IBM 2250, predecessor to the IBM 3250 and IBM 5080, and IBM 2260,[3] predecessor to the IBM 3270, introduced with System/360 in 1964. Most terminals were connected to minicomputers or mainframe computers and often had a green or amber screen. Typically terminals communicate with the computer via a serial port via a null modem cable, often using an EIA RS-232 or RS-422 or RS-423 or a current loop serial interface. IBM systems typically communicated over a Bus and Tag channel, a coaxial cable using a proprietary protocol, a communications link using Binary Synchronous Communications or IBM's SNA protocol, but for many DEC, Data General and NCR (and so on) computers there were many visual display suppliers competing against the computer manufacturer for terminals to expand the systems. In fact, the instruction design for the Intel 8008 was originally conceived at Computer Terminal Corporation as the processor for the Datapoint 2200.

From the introduction of the IBM 3270, and the DEC VT100 (1978), the user and programmer could notice significant advantages in VDU technology improvements, yet not all programmers used the features of the new terminals (backward compatibility in the VT100 and later TeleVideo terminals, for example, with "dumb terminals" allowed programmers to continue to use older software).

Some dumb terminals had been able to respond to a few escape sequences without needing microprocessors: they used multiple printed circuit boards with many integrated circuits; the single factor that classed a terminal as "intelligent" was its ability to process user-input within the terminal—not interrupting the main computer at each keystroke—and send a block of data at a time (for example: when the user has finished a whole field or form). Most terminals in the early 1980s, such as ADM-3A, TVI912, Data General D2, DEC VT52, despite the introduction of ANSI terminals in 1978, were essentially "dumb" terminals, although some of them (such as the later ADM and TVI models) did have a primitive block-send capability. Common early uses of local processing power included features that had little to do with off-loading data processing from the host computer but added useful features such as printing to a local printer, buffered serial data transmission and serial handshaking (to accommodate higher serial transfer speeds), and more sophisticated character attributes for the display, as well as the ability to switch emulation modes to mimic competitor's models, that became increasingly important selling features during the 1980s especially, when buyers could mix and match different suppliers' equipment to a greater extent than before.

The advance in microprocessors and lower memory costs made it possible for the terminal to handle editing operations such as inserting characters within a field that may have previously required a full screen-full of characters to be re-sent from the computer, possibly over a slow modem line. Around the mid-1980s most intelligent terminals, costing less than most dumb terminals would have a few years earlier, could provide enough user-friendly local editing of data and send the completed form to the main computer. Providing even more processing possibilities, workstations like the TeleVideo TS-800 could run CP/M-86, blurring the distinction between terminal and Personal Computer.

Another of the motivations for development of the microprocessor was to simplify and reduce the electronics required in a terminal. That also made it practicable to load several "personalities" into a single terminal, so a Qume QVT-102 could emulate many popular terminals of the day, and so be sold into organizations that did not wish to make any software changes. Frequently emulated terminal types included:

The ANSI X3.64 escape code standard produced uniformity to some extent, but significant differences remained. For example, the VT100, Heathkit H19 in ANSI mode, Televideo 970, Data General D460, and Qume QVT-108 terminals all followed the ANSI standard, yet differences might exist in codes from function keys, what character attributes were available, block-sending of fields within forms, "foreign" character facilities, and handling of printers connected to the back of the screen.

In the 21st century,

the term Intelligent Terminal can now refer to a retail Point of Sale computer.[4]

Emulators

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).[5][6][7][8]

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 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.[5][9] 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).[10]

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.[11]

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.

Examples of terminals emulated

Many terminal emulators have been developed for 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, Sun console, QNX, AT386, SCO-ANSI, SNI 97801, Televideo, and Wyse 50/60. Additionally, programs have been developed to emulate other terminal emulators such as xterm and assorted console terminals (e.g., for Linux). Finally, some emulators simply refer to a standard, such as ANSI. Such programs are available on many platforms ranging from DOS and Unix to Windows and macOS to 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.[12]

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.[13] 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.[14]

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

System loading

The program startx starts the X Window System on a new virtual console. There are also other graphical programs that can start from the console (e.g. LinuxTV and MPlayer etc.)

See also

Notes

  1. "intelligent terminal Definition from PC Magazine Encyclopedia". https://www.pcmag.com/encyclopedia/term/45110/intelligent-terminal. 
  2. Twentieth Century Words; by John Ayto; Oxford Unity Press; page 413
  3. "What is 3270 (Information Display System)". https://whatis.techtarget.com/definition/3270-Information-Display-System. "3270 .. over its predecessor, the 2260" 
  4. "Epson TM-T88V-DT Intelligent Terminal, 16GB SSD, LE, Linux, ...". https://www.epson.de/en/viewcon/corporatesite/products/mainunits/overview/13350. "Retailers can .. reduce costs with .. Epson TM-T88V-DT ... a unique integrated terminal" 
  5. 5.0 5.1 Daintith 2004, p. 171.
  6. Weik 2000, "echo" p. 478.
  7. Weik 2000, "echoplex" p. 479.
  8. Weik 2000, "echoplex mode" p. 479.
  9. Bangia 2010, p. 324.
  10. Stevens & Wright 1994, p. 413.
  11. Miller 2009, p. 590, 591.
  12. "A Brief History of Terminal Emulation | Turbosoft". https://www.ttwin.com/blog/270-history-terminal-emulation. 
  13. "Ubuntu Manpage: tty — general terminal interface". http://manpages.ubuntu.com/manpages/bionic/man4/tty.4freebsd.html. 
  14. "Screen dumps". The Linux keyboard and console HOWTO. The Linux Documentation Project. https://tldp.org/HOWTO/Keyboard-and-Console-HOWTO-20.html. "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)." 

References

External links