Text-based user interface: Difference between revisions

Content deleted Content added
m Reverted edits by 85.92.175.138 (talk) (HG) (3.4.4)
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5
 
(196 intermediate revisions by more than 100 users not shown)
Line 1:
{{short description|Type of interface based on outputting to or controlling a text display}}
{{distinguish|Command-line interface}}
{{refimprove|date=September 2014}}
[[File:Synchronet.png|thumb|300px|Snapshot of a TUI used in a BBS system called [[Synchronet]].]]
[[File:Midnight Commander (2005) en.png|thumb|300px|Some [[file manager]]s implement a TUI (''here: [[Midnight Commander]]'')]]
[[File:Vim-%28logiciel%29-console.png|thumb|300px|[[Vim (text editor)|Vim]] is a very widely used TUI text editor]]
 
In [[computing]], '''Texttext-based user interfaceinterfaces''' ('''TUI'''), also called(alternately '''textualterminal user interfaceinterfaces''', orto '''terminalreflect usera interface''',{{clarify|isdependence itupon the sameproperties thing?|date=Januaryof 2012}}[[computer terminal]]s and not just text), is a [[retronym]] coineddescribing sometimea after the inventiontype of [[graphical user interface]]s (GUIUI). TUIscommon displayas an early form of [[computerhuman–computer graphicsinteraction]], before the advent of bitmapped displays and modern inconventional [[textgraphical modeuser interface]]s (GUIs). AnLike advancedmodern TUI mayGUIs, likethey GUIs,can use the entire [[Electronic visual display|screen]] area and may accept [[mousecomputer (computing)mouse|mouse]] and other inputs. <!--They [[VisiCalc]]may also use color and often structure the [[Emacs]]display andusing [[vi]]box-drawing [[visual editorcharacter]]s aresuch theas earliest examplesand ╣. The modern context of TUIs.use -->is usually a [[terminal emulator]].
<!-- [[VisiCalc]] and the [[Emacs]] and [[Vi (text editor)|vi]] [[visual editor]]s are the earliest examples of TUIs. -->
 
== Types of text terminals ==
Line 14 ⟶ 15:
# A remote [[text terminal]]. The communication capabilities usually become reduced to a [[serial line]] or its emulation, possibly with few [[ioctl]]()s as an [[Out-of-band data|out-of-band]] channel in such cases as [[Telnet]] and [[Secure Shell]]. This is the worst case, because software restrictions hinder the use of capabilities of a remote display device.
 
Under [[Linux kernel|Linux]] and other [[Unix-like]] systems, a program easily [[graceful degradation|accommodates]] to any of the three cases because the same interface (namely, [[standard streams]]) controls the display and keyboard. Also, [[#Under Unix-like systems|specialized programming libraries]] help to output the text in a way appropriate to the given display device and interface to it. See [[#Windows|below]] for a comparison to Windows.
 
Many [[#See also|TUI programming libraries]] are available to help developers build [[Console application|TUI applications]].
 
== On ANSI-compatible terminals ==
[[American National Standards Institute]] (ANSI) standard [[ANSI X3.64]] defines a standard set of [[escape sequence]]s that can be used to drive terminals to create TUIs (see [[ANSI escape code]]). Escape sequences may be supported for all three cases mentioned in the above section, allowing randomarbitrary [[text cursor|cursor]] movements and color changes.
However, not all terminals follow this standard, and many non-compatible but functionally equivalent sequences exist.
 
Line 23 ⟶ 26:
 
== Under DOS and Microsoft Windows ==
[[File:Fdedit.png|thumb|250px300px|The [[FreeDOS]] Edit user interface]]
On [[IBM Personal Computer]]s and [[IBM PC compatible|compatibles]], the Basic Input Output System ([[BIOS]]) and [[DOS]] system calls provide a way to write text on the screen, and the [[ANSI.SYS]] driver could process standard ANSI escape sequences. However, programmers soon learned that writing data directly to the [[screen buffer]] was far faster and simpler to program, and less error-prone; see [[VGA-compatible text mode]] for details. This change in programming methods resulted in many DOS TUI programs. {{anchor|Windows}}The [[win32Windows console]] environment is notorious for its emulation of certain EGA/VGA text mode features, particularly random access to the text buffer, even if the application runs in a window. On the other hand, programs running under Windows (both native and DOS applications) have much less control of the display and keyboard than Linux and DOS programs can have, because of aforementioned win32Windows console layer.
 
[[File:itmouse.png|thumb|320px300px|left|Mouse cursor in [[Impulse Tracker]]. A more precise cursor (per-pixel resolution) was achieved by regenerating the glyphs of characters used where the cursor was visible, at each mouse movement in real-time.{{citation needed|date=December 2011}}]]
 
Most often those programs used a blue background for the main screen, with white or yellow characters, although commonly they had also user color customization. They often used [[box-drawing character]]s in IBM's [[code page 437]]. Later, the interface became deeply influenced by [[graphical user interface]]s (GUI), adding [[pull-down menu]]s, overlapping [[window (computing)|windows]], [[dialog box]]es and [[GUI widget]]s operated by [[mnemonics (keyboard)|mnemonics]] or [[keyboard shortcut]]s. Soon [[computer mouse|mouse]] input was added&nbsp;– either at text resolution as a simple colored box or at graphical resolution thanks to the ability of the [[Enhanced Graphics Adapter]] (EGA) and [[Video Graphics Array]] (VGA) display adapters to [[VGA-compatible text mode#Fonts|redefine the text character shapes by software]]&nbsp;– providing additional functions.
 
Some notable programs of this kind were [[Microsoft Word]], [[DOS Shell]], [[WordPerfect]], [[Norton Commander]], [[Turbo Vision]] based [[Borland]] [[Turbo Pascal]] and [[Borland Turbo C|Turbo C]] (the latter included the [[conio.h|conio]] [[library (computer science)|library]]), [[Lotus 1-2-3]] and many others. Some of these interfaces survived even during the [[Microsoft]] [[Windows 3.1x]] period in the early 1990s. For example, the [[Microsoft C]] 6.0 compiler, used to write true GUI programs under [[16-bit]] Windows, still has its own TUI.
 
Since its start, [[Microsoft Windows]] includes a console to display DOS software. Later versions added the [[Win32Windows console]] as a native interface for [[command-line interface]] and TUI programs. The console usually opens in window mode, but it can be switched to full, true text mode screen and vice versa by pressing the [[Alt key|Alt]] and [[Enter key|Enter]] keys together. Full-screen mode is not available in Windows Vista and later, but may be used with some workarounds.<ref>[http://social.technet.microsoft.com/Forums/en/w7itprohardware/thread/3cc6994e-cbc2-4844-b040-a3c8385c69a5 cmd prompt full screen in Windows 7]. Social.technet.microsoft.com. Retrieved on 2013-06-15.</ref>
{{-}}
 
[[Windows Terminal]] is a [[Tabbed|multi-tabbed]] [[terminal emulator]] that [[Microsoft]] has developed for [[Windows 10]] and later<ref>{{cite web|url=https://www.theverge.com/2019/5/6/18527870/microsoft-windows-terminal-command-line-tool|title=Microsoft unveils Windows Terminal, a new command line app for Windows|first=Tom|last=Warren|date=May 6, 2019|website=The Verge}}</ref> as a replacement for [[Windows Console]].
== Under Unix-like systems ==
[[File:XFdrake.png|thumb|250px|Snapshot of 'XFdrake', a TUI used in [[Mandriva Linux]] to configure the graphical system.]]
In [[Unix-like]] operating systems, TUIs are often constructed using the terminal control [[library (computer science)|library]] ''[[curses (programming library)|curses]]'', or ''[[ncurses]]'', a mostly compatible library.
 
The [[Windows Subsystem for Linux]] which was added to Windows by [[Microsoft]] in 2019, supports running [[Linux]] text-based apps on Windows, within [[Windows console]], [[Windows Terminal]], and other Windows-based terminals.
The advent of the ''curses'' library with [[BSD|Berkeley Unix]] created a portable and stable API for which to write TUIs. The ability to talk to various [[text terminal]] types using the same [[application programming interface|interfaces]] led to more widespread use of "visual" Unix programs, which occupied the entire terminal screen instead of using a simple line interface. This can be seen in [[text editor]]s such as [[vi]], [[E-mail client|mail clients]] such as [[pine (e-mail client)|pine]] or [[mutt (e-mail client)|mutt]], system management tools such as [[IBM AIX SMIT|SMIT]], [[SAM (HP-UX)|SAM]], [[FreeBSD]]'s [[Sysinstall]] and [[web browser]]s such as [[lynx (web browser)|lynx]]. Some applications, such as [[w3m]], and older versions of [[pine (e-mail client)|pine]] and [[vi]] use the less-able [[termcap]] library, performing many of the functions associated with [[curses (programming library)|curses]] within the application.
 
== Under Unix-like systems ==
[[File:XFdrake.png|thumb|250px300px|Snapshot of 'XFdrake', a TUI used in [[Mandriva Linux]] to configure the graphical system.]]
[[File:Btop screenshot.png|thumb|300px|btop - task manager utility for Linux and other unix-like OS]]
In [[Unix-like]] operating systems, TUIs are often constructed using the terminal control [[library (computer science)|library]] ''[[curses (programming library)|curses]]'', or ''[[ncurses]]'' (a mostly compatible library), or the alternative ''[[S-Lang]]'' library. The advent of the ''curses'' library with [[BSDBerkeley Software Distribution|Berkeley Unix]] created a portable and stable API for which to write TUIs. The ability to talk to various [[text terminal]] types using the same [[application programming interfaceAPI|interfaces]] led to more widespread use of "visual" Unix programs, which occupied the entire terminal screen instead of using a simple line interface. This can be seen in [[text editor]]s such as [[Vi (text editor)|vi]], [[E-mailEmail client|mail clients]] such as [[pine (e-mailemail client)|pine]] or [[mutt (e-mailemail client)|mutt]], system management tools such as [[IBMSystem AIXManagement SMITInterface Tool|SMIT]], [[SAM (HP-UX)|SAM]], [[FreeBSD]]'s [[Sysinstall]] and [[web browser]]s such as [[lynx (web browser)|lynx]]. Some applications, such as [[w3m]], and older versions of pine and [[pineVi (e-mailtext clienteditor)|pine]] and [[vi]] use the less-able [[termcap]] library, performing many of the functions associated with [[curses (programming library)|curses]] within the application. Custom TUI applications based on ''widgets'' can be easily developed using the [[Dialog (software)|dialog]] program (based on [[ncurses]]), or the [[Newt (programming library)|Whiptail]] program (based on [[S-Lang]]).
 
In addition, the rise in popularity of [[Linux]] brought many former DOS users to a Unix-like platform, which has fostered a DOS influence in many TUIs. The program [[minicom]], for example, is modeled after the popular DOS program [[Telix]]. Some other TUI programs, such as the [[Twin (windowing system)|Twin]] desktop, were [[ported]] over.
 
TheMost Unix-like operating systems (Linux, kernelFreeBSD, supportsetc.) support [[virtual console]]s, typically accessed through a Ctrl-Alt-F key combination. UpFor example, under Linux up to 64 consoles may be accessed (12 via function keys), each displaying in full-screen text mode.
 
The [[free software]] program [[GNU Screen]] provides for managing multiple sessions inside a single TUI, and so can be thought of as being like a [[window manager]] for text-mode and command-line interfaces. [[Tmux]] can also do this.
 
The proprietary [[macOS]] [[text editor]] [[BBEdit]] includes a ''shell worksheet'' function that works as a full-screen shell window. The [[free software|free]] [[Emacs]] text editor can run a shell inside of one of its buffers to provide similar functionality. There are several shell implementations in Emacs, but only <ttcode>ansi-term</ttcode> is suitable for running TUI appsprograms. The other common shell modes, <ttcode>shell</ttcode> and <ttcode>eshell</ttcode> only emulate command lines and TUI appsprograms will complain "Terminal is not fully functional" or display a garbled interface. The [[free software|free]] [[Vim (text editor)|Vim]] and [[Neovim]] text editors have terminal windows (simulating [[xterm]]). The feature is intended for running jobs, parallel builds, or tests, but can also be used (with window splits and tab pages) as a lightweight terminal multiplexer.
 
== OpenVMS ==
VAX/VMS and the (later developmentknown as [[OpenVMS]]) had a similar facility to ''curses'' known as the Screen Management facility or SMG. This could be invoked from the command line or called from programs using the [[SMG$]] library.<ref>{{cite web|url=http://h30266.www3.hpe.com/odl/vax/opsys/vmsos73/vmsos73/5935/5935pro_contents.html|title=OpenVMS RTL Screen Management (SMG$) Manual|date=2001|access-date=2021-01-01|website=hpe.com|archive-date=2020-12-04|archive-url=https://web.archive.org/web/20201204210834/http://h30266.www3.hpe.com/odl/vax/opsys/vmsos73/vmsos73/5935/5935pro_contents.html|url-status=dead}}</ref>
 
== Oberon ==
[[File:OberonScreen.PNG|thumb|300px|Screenshot of the desktop of an Oberon System showing an image and several text viewers]]
Another kind of TUI is the primary interface of the [[Oberon (operating system)|Oberon operating system]], first released in 1988 and still maintained. Unlike most other text-based user interfaces, Oberon does not use a text-mode console or terminal, but requires a large bit-mapped display, on which text is the primary target for mouse clicks. Analogous to a [[Hyperlink|link]] in [[hypertext]], a command has the format <code>Module.Procedure ''parameters''&nbsp;~</code> and is activated with a mouse middle-click. Text displayed anywhere on the screen can be edited, and if formatted with the required command syntax, can be middle-clicked and executed. Any text file containing suitably-formatted commands can be used as a so-called '''tool text''', thus serving as a user-configurable menu. Even the output of a previous command can be edited and used as a new command. This approach is radically different from both conventional dialogue-oriented console menus or [[command-line interface]]s but bears some similarities to the worksheet interface of the [[Macintosh Programmer's Workshop#look and feel|Macintosh Programmer's Workshop]].
 
Since it does not use graphical [[Graphical widget|widgets]], only plain text, but offers comparable functionality to a [[GUI]] with a [[tiling window manager]], it is referred to as a Text User Interface or TUI. For a short introduction, see the 2nd paragraph on page four of the first published ''Report on the Oberon System''.<ref>{{cite tech report |author1-link=Niklaus Wirth |first1=Niklaus |last1=Wirth |first2=Jürg |last2=Gutknecht |date=1988 |title=The Oberon System |url=http://e-collection.library.ethz.ch/eserv/eth:3180/eth-3180-01.pdf |volume=88 |series=ETH Eidgenössische Technische Hochschule Zürich, Institut für Informatik |doi=10.3929/ethz-a-000487176 }}</ref>
 
Oberon's [[User Interface|UI]] influenced the design of the [[Acme (text editor)|Acme text editor and email client]] for the [[Plan 9 from Bell Labs]] operating system.
 
== In embedded systems ==
[[File:MicroVGA TUI demoapp.jpg|thumb|250px|Embedded system displaying menu on an LCD screen]]
 
Modern [[embedded system]]s are capable of displaying TUI on a monitor like personal computers. This functionality is usually implemented using specialized integrated circuits, modules, or using [[FPGA]].
 
Line 63 ⟶ 78:
* Later [[Apple II]] models included [[MouseText]], a set of graphical glyphs used for making a TUI.
* The [[Corvus Concept]] computer of 1982 used a [[function key]]-based text interface on a full-page pivoting display.
* Another kind of TUI was the primary interface of the [[Oberon operating system]] as released in 1988[[Image:OberonScreen.PNG|250px|right|thumb|Screenshot of the desktop of an Oberon System showing an image and several text viewers]]. In contrast to the so far mentioned uses of text user interfaces, the Oberon system did not use a console or terminal based mode but required a large bit-mapped display on which text was used as primary target for mouse clicks. Commands of the form ''Module.Procedure parameters&nbsp;~'' were activated by a middle-mouse click on ''Module.Procedure''. Any text displayed on the screen could be edited and every command displayed in a text, which complied to the required syntax, could be clicked and executed. Any text with a bunch of commands could be used as a so-called tool text serving as a user-configurable menu. Even the output of a previous command could be edited and used as a command. This approach is radically different from the dialogue oriented command prompt and console menus described so far. Since it did not use graphical elements, but text elements, it was termed a text user interface. For a short introduction see the 2nd paragraph on p.4 of the first published report<ref>Niklaus Wirth & Jürg Gutknecht: (1988) The Oberon System. [http://e-collection.library.ethz.ch/eserv/eth:3180/eth-3180-01.pdf Report Nr. 88].</ref> on the [[Oberon operating system|Oberon System]].
 
== See also ==
* [[Command-line interface]] (CLI)
* [[Console application]] (Pending potential merge to this article)
* [[Natural-language user interface]]
* [[Text-based game]], a game using a TUI
* [[VGA text mode]]
* [[IBM Monochrome Display Adapter|MDA]]
 
=== Examples of programming libraries ===
Line 75 ⟶ 92:
* [[CDK (programming library)|CDK]]
* [[Newt (programming library)|Newt]], a widget-based toolkit
* [[S-Lang]]
* [[Turbo Vision]]
* [[Visual Basic#History (classic)|Early versions of Visual Basic]]
 
== References ==
{{Reflist}}
 
{{User interfaces}}
{{Operating system}}