Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to see a all the capabilities (terminfo or termcap) of the current terminal on command line?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You can use infocmp -L -1 to print out a terminfo entry for current TERM.

I'm not sure of an equivalent for termcap but termcap is readable plain text (if you know it's capability codes). I guess you could make use of captoinfo in conjunction with infocmp

share|improve this answer
    
To be clear: Just infocmp also works (the -I −1 option formats it with one capability per line). –  Chris Page Jul 4 '12 at 2:10
    
@ChrisPage: Good point. Actually I meant to write -L not -I, which gives longer names that are easier to understand if you are unfamiliar with terminfo capability names. The -1 aids readability. –  RedGrittyBrick Jul 4 '12 at 8:41

To show all of the capabilities of a terminal using ncurses, you need different options than were suggested earlier. The -L and -1 options show long names and a single column, respectively.

Since release 5.0 in 1999, ncurses has supported user-definable (extended) capabilities which may be compiled into a terminfo entry if the tic -x option is given. xterm and other terminal entries use these, for additional function key definitions and other features. There is a summary of these in the terminal database.

Since 2004, infocmp has had a comparable -x option, which is used to show the extended capabilities. So you would use this to print all terminfo capabilities:

infocmp -x

You would use infocmp with different options to show the terminal description in termcap format, e.g., -C (termcap names) and -r (termcap format). termcap entries are conventionally limited to 1023 bytes. However, since all of the data is from the terminal database (terminfo), ncurses can optionally relax that limit, e.g., using -T. Finally, using the -x option, infocmp can display user-defined capabilities in termcap format — provided that their names are no longer than 2 characters.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.