Text-based user interface: Difference between revisions

Content deleted Content added
g
Tag: Reverted
m Reverting possible vandalism by 188.240.176.30 to version by Serols. Report False Positive? Thanks, ClueBot NG. (4079473) (Bot)
Line 5:
[[File:Vim-%28logiciel%29-console.png|thumb|300px|[[Vim (text editor)|Vim]] is a very widely used TUI text editor]]
 
In [[computing]], '''text-based user interfaces''' ('''TUI''') (alternately '''terminal user interfaces''', to reflect a dependence upon the properties of [[computer terminal]]s and not just text), is a [[retronym]] describing a type of [[user interface]] (UI) common as an early form of [[human–computer interaction]], before the advent of [[graphical user interface]]s (GUIs). Like GUIs, they may use the entire [[Electronic visual display|screen]] area and accept [[mouse (computing)|mouse]] and other inputs. They may also use color and often structure the display using special graphical [[Character (computing)|character]]s such as ┌ and ╣, referred to in [[Unicode]] as the "box drawing" set. The modern context of use is usually a [[terminal emulator]].
In [[computing]], '''text-based user interfaces''' ('''TUI''') (alternately '''terminal user interfaces''', to reflect a dep
<!-- [[VisiCalc]] and the [[Emacs]] and [[vi]] [[visual editor]]s are the earliest examples of TUIs. -->
 
== Types of text terminals ==
From [[console application|text application]]'s point of view, a text screen (and communications with it) can belong to one of three types (here ordered in order of decreasing accessibility):
 
# A genuine [[text mode]] display, controlled by a [[video adapter]] or the central processor itself. This is a normal condition for a locally running application on various types of [[personal computer]]s and [[mobile device]]s. If not deterred by the [[operating system]], a smart program may exploit the full power of a hardware text mode.
# A text mode [[emulator]]. Examples are [[xterm]] for [[X&nbsp;Window System]] and [[win32 console]] (in a window mode) for [[Microsoft Windows]]. This usually supports programs which expect a real text mode display, but may run considerably slower. Certain functions of an advanced text mode, such as an own [[raster font|font]] uploading<!-- BTW what about raw keyboard input? -->, almost certainly become unavailable.
# 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.
 
== 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 arbitrary [[text cursor|cursor]] movements and color changes.
However, not all terminals follow this standard, and many non-compatible but functionally equivalent sequences exist.
 
{{clear}}
 
== Under DOS and Microsoft Windows ==
[[File:Fdedit.png|thumb|300px|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 [[win32 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 win32 console layer.
 
[[File:itmouse.png|thumb|300px|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 [[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 [[Win32 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>
{{-}}
 
== Under Unix-like systems ==
[[File:XFdrake.png|thumb|300px|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), or
the alternative ''[[S-Lang]]'' library.
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. 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.