World Library  
Flag as Inappropriate
Email this Article

Tput

Article Id: WHEBN0017028354
Reproduction Date:

Title: Tput  
Author: World Heritage Encyclopedia
Language: English
Subject: Text mode, Terminfo, History (Unix), Whereis, Apropos (Unix)
Collection:
Publisher: World Heritage Encyclopedia
Publication
Date:
 

Tput

In computing, tput is a standard Unix operating system command which makes use of terminal capabilities.

Depending on the system, tput uses the terminfo or termcap database, as well as looking into the environment for the terminal type.

History

Tput was provided in UNIX System V in the early 1980s. A clone of the AT&T tput was submitted to volume 7 of the mod.sources newsgroup (later comp.sources.unix) in September 1986.[1][2] In contrast to the System V program, the clone used termcap rather than terminfo. It accepted command-line parameters for the cm (cursor addressing) capability, and recognized terminfo capability names.

System V Release 3 provided an improved version which combined the different initialization capabilities as a new option init, and the reset capabilities as reset, thereby simplifying use of tput for initializing or reinitializing the terminal.[3] System V Release 3.2 added several printer-specific capabilities to the terminfo database, such as swidm (enter_doublewide_mode) which tput could use. It also added capabilities for color.

System V Release 4 defined additional terminfo capabilities including standardized ANSI color capabilities setaf and setab, which could be used by tput.

BSD platforms provided a different implementation of tput in 4.3BSD-Reno (June 1990).[4] It used termcap, recognizing only termcap capability names, and did not accept command-line parameters for cursor-addressing. FreeBSD used this in 1994, improving it by accepting one or two numeric command-line parameters.[5]

Ross Ridge's mytinfo package in 1992[6] provided a tput which accepted either termcap or terminfo capability names. Like the Reno implementation, it did not pass command-line arguments to parameterized capabilities. ncurses incorporated the mytinfo code in June 1995. The initial version added a -S option, and interpreted command-line parameters as described in the System V Release 4 documentation.

Portability

The Open Group defines one option (-T, to specify the terminal type) and three keywords (init, clear and reset). Most implementations accept the name of a terminal capability together with any parameters that may be needed for that. However, some implementations expect a termcap name, while others expect a terminfo name.

All System V Release 4 implementations, as well as those which are designed to be compatible, also recognize a -S option (to tell tput to read data from the standard input), and an additional keyword longname. They also accept command-line parameters, usually distinguishing numeric from string parameters by the form of the parameter, checking for all-numeric characters. That makes it impossible for example to set a function-key label to a string of digits. Using a different approach, ncurses determines the expected type of the parameters with a table of the terminfo capabilities which use string parameters, eliminating the ambiguity.

See also

References

  1. ^
  2. ^
  3. ^
  4. ^
  5. ^
  6. ^

Further reading

External links

Manual pages

Tutorials

  • in Bash Prompt HOWTOColours and Cursor Movement With tput
  • on IBM DeveloperWorksDiscover tput
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.