Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Let The Music Play: Join EFF Today

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents
Up to --> Basic Administration

· Terminals
· Terminal Capabilities
· Terminal Settings

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 53 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

Linux Tutorial - Basic Administration - Terminals - Terminal Capabilities
  Terminals ---- Terminal Settings  

Terminal Capabilities

If you are interacting with the system solely through command line input, you have few occasions to encounter the terminal capabilities. As the name implies, terminal capabilities determine what the terminal is capable of. For example, can the terminal move the cursor to a specific spot on the screen?

The terminal capabilities are defined by one of two databases. Older applications generally use termcap, while newer ones use terminfo. For the specifics on each, please see the appropriate man-page. Here I am going to talk about the concept of terminal capabilities and what it means to you as a user.

Within each of these databases is a mapping of the character or character sequence the terminal xxpects for certain behavior. For example, on some terminals, pressing the backspace key sends a Ctrl-? character. On others, Crtl-H is sent. When your TERM environment variable is set to the correct one for your terminal, pressing the backspace key sends a signal to the system which, in turn, tells the application that the backspace characteristic was called. The application is told not just that you pressed the key with the left arrow ( FACE="Symbol">¬) on it. Instead, the application is told that that key was the backspace. It is then up to the application to determine what is to be done.

The key benefit of a system like this is that you do not have to recompile or rewrite your application to work on different terminals. Instead, you link in the appropriate library to access either termcap or terminfo and wait for the capability that OS will send to you. When the application receives that capability (not the key), it reacts accordingly.

There are three types of capabilities. The first capabilities are Boolean, which determine whether that terminal has a particular feature. For example, does the terminal have an extra "status" line? The next type is numeric values. Examples of this capability are the number of columns and lines the terminal can display. In some cases, this may not remain constant, as terminals such as the Wyse 60 can change between 80- and 132-column mode. Last are the string capabilities that provide a character sequence to be used to perform a particular operation. Examples of this would be clearing the line from the current cursor position to the end of the line and deleting the contents of an entire line (with or without removing the line completely).

Despite that there are hundreds of possible capabilities, any given terminal will have only a small subset of capabilities. In addition, many of the capabilities do not apply to terminals, but rather to printers.

Both the termcap and terminfo databases have their own advantages and disadvantages. The termcap database is defined by the file /etc/termcap, an ASCII file that is easily modified. In contrast to this is the terminfo database, which starts out as an ASCII file but must be compiled before it can be used.

The termcap entries can be converted to terminfo with the captoinfo command and then compiled using tic, the terminfo compiler. The tic utility will usually place the compiled version in a directory under /usr/lib/terminfo based on the name of the entry. For example, the ANSI terminal ends up in /usr/lib/terminfo/a and Wyse terminals end up in /usr/lib/terminfo/w.

 Previous Page
  Back to Top
Table of Contents
Next Page 
Terminal Settings


Test Your Knowledge

User Comments:

You can only add comments if you are logged in.

Copyright 2002-2009 by James Mohr. Licensed under modified GNU Free Documentation License (Portions of this material originally published by Prentice Hall, Pearson Education, Inc). See here for details. All rights reserved.



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can help in many different ways.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.08 Seconds