Contents
Where do I find the less termcap variable?
The LESS_TERMCAP_* variables can be set in the environment or in the .lesskey file. It provides Less with alternative values for Terminal capabilities. When Less wants to use a terminal capability, say switch to bold, it first checks if there is a LESS_TERMCAP_md variable.
What is the termcap library in a terminal?
The Termcap library is a description of the terminal’s facilities. Each facility is identified by a two-letter (or more generally two-character) code. For example, hc identifies hardcopy terminals (i.e. printers, not screens); co is the number of columns; md starts displaying bold text.
Can you use termcap in a terminal emulator?
Nowadays most terminal emulators have very similar capabilities, but the Termcap or Terminfo database is still useful to cope with minor differences. The LESS_TERMCAP_* variables can be set in the environment or in the .lesskey file. It provides Less with alternative values for Terminal capabilities.
When does less want to use a terminal capability?
When Less wants to use a terminal capability, say switch to bold, it first checks if there is a LESS_TERMCAP_md variable. If this variable exists, Less uses its value as the escape sequence to switch to bold.
How to use the termcap library in a program?
To use the termcap library in a program, you need two kinds of preparation: The compiler needs declarations of the functions and variables in the library. On GNU systems, it suffices to include the header file `termcap.h’ in each source file that uses these functions and variables.
Do you need to use termcap in man page?
You need to use the termcap (5) feature. The man page on some Unices says this tool is obsolete and to use terminfo, but it’s still available on others (and terminfo is more complicated). More importantly, less uses termcap. I do the following so that less and man (which uses less) will have color: