micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1 | <!-- |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2 | * t |
| 3 | * DO NOT EDIT THIS FILE BY HAND! |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 4 | * It is generated from terminfo.head, ./../include/Caps ./../include/Caps-ncurses, and terminfo.tail. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 5 | * Note: this must be run through tbl before nroff. |
| 6 | * The magic cookie on the first line triggers this under some man programs. |
| 7 | **************************************************************************** |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 8 | * Copyright 2018-2023,2024 Thomas E. Dickey * |
| 9 | * Copyright 1998-2016,2017 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 10 | * * |
| 11 | * Permission is hereby granted, free of charge, to any person obtaining a * |
| 12 | * copy of this software and associated documentation files (the * |
| 13 | * "Software"), to deal in the Software without restriction, including * |
| 14 | * without limitation the rights to use, copy, modify, merge, publish, * |
| 15 | * distribute, distribute with modifications, sublicense, and/or sell * |
| 16 | * copies of the Software, and to permit persons to whom the Software is * |
| 17 | * furnished to do so, subject to the following conditions: * |
| 18 | * * |
| 19 | * The above copyright notice and this permission notice shall be included * |
| 20 | * in all copies or substantial portions of the Software. * |
| 21 | * * |
| 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 23 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 24 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 25 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 26 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 27 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 28 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 29 | * * |
| 30 | * Except as contained in this notice, the name(s) of the above copyright * |
| 31 | * holders shall not be used in advertising or otherwise to promote the * |
| 32 | * sale, use or other dealings in this Software without prior written * |
| 33 | * authorization. * |
| 34 | **************************************************************************** |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 35 | * @Id: terminfo.head,v 1.65 2024/04/20 21:14:00 tom Exp @ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 36 | --> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 37 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 38 | <HTML> |
| 39 | <HEAD> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 40 | <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 41 | <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts"> |
| 42 | <TITLE>terminfo 5 2024-04-20 ncurses 6.5 File formats</TITLE> |
| 43 | <link rel="author" href="mailto:bug-ncurses@gnu.org"> |
| 44 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 45 | </HEAD> |
| 46 | <BODY> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 47 | <H1 class="no-header">terminfo 5 2024-04-20 ncurses 6.5 File formats</H1> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 48 | <PRE> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 49 | <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> File formats <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 50 | |
| 51 | |
| 52 | |
| 53 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 54 | </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE> |
| 55 | <STRONG>terminfo</STRONG> - terminal capability database |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 56 | |
| 57 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 58 | </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 59 | /usr/share/terminfo/*/* |
| 60 | |
| 61 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 62 | </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE> |
| 63 | <EM>Terminfo</EM> is a database describing terminals, used by screen-oriented |
| 64 | programs such as <STRONG>nvi(1)</STRONG>, <STRONG>lynx(1)</STRONG>, <STRONG>mutt(1)</STRONG>, and other curses |
| 65 | applications, using high-level calls to libraries such as <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>. |
| 66 | It is also used via low-level calls by non-curses applications which |
| 67 | may be screen-oriented (such as <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>) or non-screen (such as |
| 68 | <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 69 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 70 | <EM>Terminfo</EM> describes terminals by giving a set of capabilities which they |
| 71 | have, by specifying how to perform screen operations, and by specifying |
| 72 | padding requirements and initialization sequences. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 73 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 74 | This document describes <EM>ncurses</EM> version 6.5 (patch 20240427). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 75 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 76 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 77 | </PRE><H3><a name="h3-terminfo-Entry-Syntax"><EM>terminfo</EM> Entry Syntax</a></H3><PRE> |
| 78 | Entries in <EM>terminfo</EM> consist of a sequence of fields: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 79 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 80 | <STRONG>o</STRONG> Each field ends with a comma "," (embedded commas may be escaped |
| 81 | with a backslash or written as "\054"). |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 82 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 83 | <STRONG>o</STRONG> White space between fields is ignored. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 84 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 85 | <STRONG>o</STRONG> The first field in a <EM>terminfo</EM> entry begins in the first column. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 86 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 87 | <STRONG>o</STRONG> Newlines and leading whitespace (spaces or tabs) may be used for |
| 88 | formatting entries for readability. These are removed from parsed |
| 89 | entries. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 90 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 91 | The <STRONG>infocmp</STRONG> <STRONG>-f</STRONG> and <STRONG>-W</STRONG> options rely on this to format if-then-else |
| 92 | expressions, or to enforce maximum line-width. The resulting |
| 93 | formatted terminal description can be read by <STRONG>tic</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 94 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 95 | <STRONG>o</STRONG> The first field for each terminal gives the names which are known |
| 96 | for the terminal, separated by "|" characters. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 97 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 98 | The first name given is the most common abbreviation for the |
| 99 | terminal (its primary name), the last name given should be a long |
| 100 | name fully identifying the terminal (see <STRONG><A HREF="curs_termattrs.3x.html">longname(3x)</A></STRONG>), and all |
| 101 | others are treated as synonyms (aliases) for the primary terminal |
| 102 | name. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 103 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 104 | X/Open Curses advises that all names but the last should be in |
| 105 | lower case and contain no blanks; the last name may well contain |
| 106 | upper case and blanks for readability. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 107 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 108 | This implementation is not so strict; it allows mixed case in the |
| 109 | primary name and aliases. If the last name has no embedded blanks, |
| 110 | it allows that to be both an alias and a verbose name (but will |
| 111 | warn about this ambiguity). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 112 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 113 | <STRONG>o</STRONG> Lines beginning with a "#" in the first column are treated as |
| 114 | comments. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 115 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 116 | While comment lines are valid at any point, the output of <STRONG>captoinfo</STRONG> |
| 117 | and <STRONG>infotocap</STRONG> (aliases for <STRONG>tic</STRONG>) will move comments so they occur |
| 118 | only between entries. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 119 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 120 | Terminal names (except for the last, verbose entry) should be chosen |
| 121 | using the following conventions. The particular piece of hardware |
| 122 | making up the terminal should have a root name, thus "hp2621". This |
| 123 | name should not contain hyphens. Modes that the hardware can be in, or |
| 124 | user preferences, should be indicated by appending a hyphen and a mode |
| 125 | suffix. Thus, a vt100 in 132-column mode would be vt100-w. The |
| 126 | following suffixes should be used where possible: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 127 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 128 | <STRONG>Suffix</STRONG> <STRONG>Example</STRONG> <STRONG>Meaning</STRONG> |
| 129 | ------------------------------------------------------------------------ |
| 130 | -<EM>nn</EM> aaa-60 Number of lines on the screen |
| 131 | -<EM>n</EM>p c100-4p Number of pages of memory |
| 132 | -am vt100-am With automargins (usually the default) |
| 133 | -m ansi-m Mono mode; suppress color |
| 134 | -mc wy30-mc Magic cookie; spaces when highlighting |
| 135 | -na c100-na No arrow keys (leave them in local) |
| 136 | -nam vt100-nam Without automatic margins |
| 137 | -nl hp2621-nl No status line |
| 138 | -ns hp2626-ns No status line |
| 139 | -rv c100-rv Reverse video |
| 140 | -s vt100-s Enable status line |
| 141 | -vb wy370-vb Use visible bell instead of beep |
| 142 | -w vt100-w Wide mode (> 80 columns, usually 132) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 143 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 144 | For more on terminal naming conventions, see the <STRONG><A HREF="term.7.html">term(7)</A></STRONG> manual page. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 145 | |
| 146 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 147 | </PRE><H3><a name="h3-terminfo-Capabilities-Syntax"><EM>terminfo</EM> Capabilities Syntax</a></H3><PRE> |
| 148 | The terminfo entry consists of several <EM>capabilities</EM>, i.e., features |
| 149 | that the terminal has, or methods for exercising the terminal's |
| 150 | features. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 151 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 152 | After the first field (giving the name(s) of the terminal entry), there |
| 153 | should be one or more <EM>capability</EM> fields. These are Boolean, numeric or |
| 154 | string names with corresponding values: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 155 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 156 | <STRONG>o</STRONG> Boolean capabilities are true when present, false when absent. |
| 157 | There is no explicit value for Boolean capabilities. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 158 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 159 | <STRONG>o</STRONG> Numeric capabilities have a "#" following the name, then an |
| 160 | unsigned decimal integer value. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 161 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 162 | <STRONG>o</STRONG> String capabilities have a "=" following the name, then an string |
| 163 | of characters making up the capability value. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 164 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 165 | String capabilities can be split into multiple lines, just as the |
| 166 | fields comprising a terminal entry can be split into multiple |
| 167 | lines. While blanks between fields are ignored, blanks embedded |
| 168 | within a string value are retained, except for leading blanks on a |
| 169 | line. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 170 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 171 | Any capability can be <EM>canceled</EM>, i.e., suppressed from the terminal |
| 172 | entry, by following its name with "@" rather than a capability value. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 173 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 174 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 175 | </PRE><H3><a name="h3-Similar-Terminals">Similar Terminals</a></H3><PRE> |
| 176 | If there are two very similar terminals, one (the variant) can be |
| 177 | defined as being just like the other (the base) with certain |
| 178 | exceptions. In the definition of the variant, the string capability |
| 179 | <STRONG>use</STRONG> can be given with the name of the base terminal: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 180 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 181 | <STRONG>o</STRONG> The capabilities given before <STRONG>use</STRONG> override those in the base type |
| 182 | named by <STRONG>use</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 183 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 184 | <STRONG>o</STRONG> If there are multiple <STRONG>use</STRONG> capabilities, they are merged in reverse |
| 185 | order. That is, the rightmost <STRONG>use</STRONG> reference is processed first, |
| 186 | then the one to its left, and so forth. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 187 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 188 | <STRONG>o</STRONG> Capabilities given explicitly in the entry override those brought |
| 189 | in by <STRONG>use</STRONG> references. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 190 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 191 | A capability can be canceled by placing <STRONG>xx@</STRONG> to the left of the use |
| 192 | reference that imports it, where <EM>xx</EM> is the capability. For example, |
| 193 | the entry |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 194 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 195 | 2621-nl, smkx@, rmkx@, use=2621, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 196 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 197 | defines a 2621-nl that does not have the <STRONG>smkx</STRONG> or <STRONG>rmkx</STRONG> capabilities, and |
| 198 | hence does not turn on the function key labels when in visual mode. |
| 199 | This is useful for different modes for a terminal, or for different |
| 200 | user preferences. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 201 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 202 | An entry included via <STRONG>use</STRONG> can contain canceled capabilities, which have |
| 203 | the same effect as if those cancels were inline in the using terminal |
| 204 | entry. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 205 | |
| 206 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 207 | </PRE><H3><a name="h3-Predefined-Capabilities">Predefined Capabilities</a></H3><PRE> |
| 208 | Tables of capabilities <EM>ncurses</EM> recognizes in a <EM>terminfo</EM> terminal type |
| 209 | description and available to <EM>terminfo</EM>-using code follow. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 210 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 211 | <STRONG>o</STRONG> The capability name identifies the symbol by which the programmer |
| 212 | using the <EM>terminfo</EM> API accesses the capability. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 213 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 214 | <STRONG>o</STRONG> The TI (<EM>terminfo</EM>) code is the short name used by a person composing |
| 215 | or updating a terminal type entry. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 216 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 217 | Whenever possible, these codes are the same as or similar to those |
| 218 | of the ANSI X3.64-1979 standard (now superseded by ECMA-48, which |
| 219 | uses identical or very similar names). Semantics are also intended |
| 220 | to match those of the specification. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 221 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 222 | <EM>terminfo</EM> codes have no hard length limit, but <EM>ncurses</EM> maintains an |
| 223 | informal one of 5 characters to keep them short and to allow the |
| 224 | tabs in the source file <EM>Caps</EM> to line up nicely. (Some standard |
| 225 | codes exceed this limit regardless.) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 226 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 227 | <STRONG>o</STRONG> The TC (<EM>termcap</EM>) code is that used by the corresponding API of |
| 228 | <EM>ncurses</EM>. (Some capabilities are new, and have names that BSD |
| 229 | <EM>termcap</EM> did not originate.) |
| 230 | |
| 231 | <STRONG>o</STRONG> The description field attempts to convey the capability's |
| 232 | semantics. |
| 233 | |
| 234 | The description field employs a handful of notations. |
| 235 | |
| 236 | <STRONG>(P)</STRONG> indicates that padding may be specified. |
| 237 | |
| 238 | <STRONG>(P*)</STRONG> indicates that padding may vary in proportion to the number of |
| 239 | output lines affected. |
| 240 | |
| 241 | <STRONG>#</STRONG><EM>i</EM> indicates the <EM>i</EM>th parameter of a string capability; the |
| 242 | programmer should pass the string to <STRONG><A HREF="curs_terminfo.3x.html">tparm(3x)</A></STRONG> with the |
| 243 | parameters listed. |
| 244 | |
| 245 | If the description lists no parameters, passing the string to |
| 246 | <STRONG><A HREF="curs_terminfo.3x.html">tparm(3x)</A></STRONG> may produce unexpected behavior, for instance if the |
| 247 | string contains percent signs. |
| 248 | |
| 249 | <STRONG>Code</STRONG> |
| 250 | <STRONG>Boolean</STRONG> <STRONG>Capability</STRONG> <STRONG>Name</STRONG> <STRONG>TI</STRONG> <STRONG>TC</STRONG> <STRONG>Description</STRONG> |
| 251 | ------------------------------------------------------------------------ |
| 252 | |
| 253 | |
| 254 | <STRONG>auto_left_margin</STRONG> <STRONG>bw</STRONG> <STRONG>bw</STRONG> cub1 wraps from column 0 to |
| 255 | last column |
| 256 | <STRONG>auto_right_margin</STRONG> <STRONG>am</STRONG> <STRONG>am</STRONG> terminal has automatic margins |
| 257 | <STRONG>no_esc_ctlc</STRONG> <STRONG>xsb</STRONG> <STRONG>xb</STRONG> beehive (f1=escape, f2=ctrl C) |
| 258 | <STRONG>ceol_standout_glitch</STRONG> <STRONG>xhp</STRONG> <STRONG>xs</STRONG> standout not erased by |
| 259 | overwriting (hp) |
| 260 | <STRONG>eat_newline_glitch</STRONG> <STRONG>xenl</STRONG> <STRONG>xn</STRONG> newline ignored after 80 cols |
| 261 | (concept) |
| 262 | <STRONG>erase_overstrike</STRONG> <STRONG>eo</STRONG> <STRONG>eo</STRONG> can erase overstrikes with a |
| 263 | blank |
| 264 | <STRONG>generic_type</STRONG> <STRONG>gn</STRONG> <STRONG>gn</STRONG> generic line type |
| 265 | <STRONG>hard_copy</STRONG> <STRONG>hc</STRONG> <STRONG>hc</STRONG> hardcopy terminal |
| 266 | <STRONG>has_meta_key</STRONG> <STRONG>km</STRONG> <STRONG>km</STRONG> Has a meta key (i.e., sets |
| 267 | 8th-bit) |
| 268 | <STRONG>has_status_line</STRONG> <STRONG>hs</STRONG> <STRONG>hs</STRONG> has extra status line |
| 269 | <STRONG>insert_null_glitch</STRONG> <STRONG>in</STRONG> <STRONG>in</STRONG> insert mode distinguishes |
| 270 | nulls |
| 271 | <STRONG>memory_above</STRONG> <STRONG>da</STRONG> <STRONG>da</STRONG> display may be retained above |
| 272 | the screen |
| 273 | <STRONG>memory_below</STRONG> <STRONG>db</STRONG> <STRONG>db</STRONG> display may be retained below |
| 274 | the screen |
| 275 | <STRONG>move_insert_mode</STRONG> <STRONG>mir</STRONG> <STRONG>mi</STRONG> safe to move while in insert |
| 276 | mode |
| 277 | <STRONG>move_standout_mode</STRONG> <STRONG>msgr</STRONG> <STRONG>ms</STRONG> safe to move while in standout |
| 278 | mode |
| 279 | <STRONG>over_strike</STRONG> <STRONG>os</STRONG> <STRONG>os</STRONG> terminal can overstrike |
| 280 | <STRONG>status_line_esc_ok</STRONG> <STRONG>eslok</STRONG> <STRONG>es</STRONG> escape can be used on the |
| 281 | status line |
| 282 | <STRONG>dest_tabs_magic_smso</STRONG> <STRONG>xt</STRONG> <STRONG>xt</STRONG> tabs destructive, magic so |
| 283 | char (t1061) |
| 284 | <STRONG>tilde_glitch</STRONG> <STRONG>hz</STRONG> <STRONG>hz</STRONG> cannot print ~'s (Hazeltine) |
| 285 | <STRONG>transparent_underline</STRONG> <STRONG>ul</STRONG> <STRONG>ul</STRONG> underline character |
| 286 | overstrikes |
| 287 | <STRONG>xon_xoff</STRONG> <STRONG>xon</STRONG> <STRONG>xo</STRONG> terminal uses xon/xoff |
| 288 | handshaking |
| 289 | <STRONG>needs_xon_xoff</STRONG> <STRONG>nxon</STRONG> <STRONG>nx</STRONG> padding will not work, |
| 290 | xon/xoff required |
| 291 | <STRONG>prtr_silent</STRONG> <STRONG>mc5i</STRONG> <STRONG>5i</STRONG> printer will not echo on |
| 292 | screen |
| 293 | <STRONG>hard_cursor</STRONG> <STRONG>chts</STRONG> <STRONG>HC</STRONG> cursor is hard to see |
| 294 | <STRONG>non_rev_rmcup</STRONG> <STRONG>nrrmc</STRONG> <STRONG>NR</STRONG> smcup does not reverse rmcup |
| 295 | <STRONG>no_pad_char</STRONG> <STRONG>npc</STRONG> <STRONG>NP</STRONG> pad character does not exist |
| 296 | <STRONG>non_dest_scroll_region</STRONG> <STRONG>ndscr</STRONG> <STRONG>ND</STRONG> scrolling region is non- |
| 297 | destructive |
| 298 | <STRONG>can_change</STRONG> <STRONG>ccc</STRONG> <STRONG>cc</STRONG> terminal can re-define |
| 299 | existing colors |
| 300 | <STRONG>back_color_erase</STRONG> <STRONG>bce</STRONG> <STRONG>ut</STRONG> screen erased with background |
| 301 | color |
| 302 | <STRONG>hue_lightness_saturation</STRONG> <STRONG>hls</STRONG> <STRONG>hl</STRONG> terminal uses only HLS color |
| 303 | notation (Tektronix) |
| 304 | <STRONG>col_addr_glitch</STRONG> <STRONG>xhpa</STRONG> <STRONG>YA</STRONG> only positive motion for |
| 305 | hpa/mhpa caps |
| 306 | <STRONG>cr_cancels_micro_mode</STRONG> <STRONG>crxm</STRONG> <STRONG>YB</STRONG> using cr turns off micro mode |
| 307 | <STRONG>has_print_wheel</STRONG> <STRONG>daisy</STRONG> <STRONG>YC</STRONG> printer needs operator to |
| 308 | change character set |
| 309 | <STRONG>row_addr_glitch</STRONG> <STRONG>xvpa</STRONG> <STRONG>YD</STRONG> only positive motion for |
| 310 | vpa/mvpa caps |
| 311 | <STRONG>semi_auto_right_margin</STRONG> <STRONG>sam</STRONG> <STRONG>YE</STRONG> printing in last column causes |
| 312 | cr |
| 313 | <STRONG>cpi_changes_res</STRONG> <STRONG>cpix</STRONG> <STRONG>YF</STRONG> changing character pitch |
| 314 | changes resolution |
| 315 | <STRONG>lpi_changes_res</STRONG> <STRONG>lpix</STRONG> <STRONG>YG</STRONG> changing line pitch changes |
| 316 | resolution |
| 317 | |
| 318 | <STRONG>Code</STRONG> |
| 319 | |
| 320 | <STRONG>Numeric</STRONG> <STRONG>Capability</STRONG> <STRONG>Name</STRONG> <STRONG>TI</STRONG> <STRONG>TC</STRONG> <STRONG>Description</STRONG> |
| 321 | ------------------------------------------------------------------------ |
| 322 | <STRONG>columns</STRONG> <STRONG>cols</STRONG> <STRONG>co</STRONG> number of columns in a line |
| 323 | <STRONG>init_tabs</STRONG> <STRONG>it</STRONG> <STRONG>it</STRONG> tabs initially every # spaces |
| 324 | <STRONG>lines</STRONG> <STRONG>lines</STRONG> <STRONG>li</STRONG> number of lines on screen or |
| 325 | page |
| 326 | <STRONG>lines_of_memory</STRONG> <STRONG>lm</STRONG> <STRONG>lm</STRONG> lines of memory if > line. 0 |
| 327 | means varies |
| 328 | <STRONG>magic_cookie_glitch</STRONG> <STRONG>xmc</STRONG> <STRONG>sg</STRONG> number of blank characters |
| 329 | left by smso or rmso |
| 330 | <STRONG>padding_baud_rate</STRONG> <STRONG>pb</STRONG> <STRONG>pb</STRONG> lowest baud rate where padding |
| 331 | needed |
| 332 | <STRONG>virtual_terminal</STRONG> <STRONG>vt</STRONG> <STRONG>vt</STRONG> virtual terminal number |
| 333 | (CB/unix) |
| 334 | <STRONG>width_status_line</STRONG> <STRONG>wsl</STRONG> <STRONG>ws</STRONG> number of columns in status |
| 335 | line |
| 336 | <STRONG>num_labels</STRONG> <STRONG>nlab</STRONG> <STRONG>Nl</STRONG> number of labels on screen |
| 337 | <STRONG>label_height</STRONG> <STRONG>lh</STRONG> <STRONG>lh</STRONG> rows in each label |
| 338 | <STRONG>label_width</STRONG> <STRONG>lw</STRONG> <STRONG>lw</STRONG> columns in each label |
| 339 | <STRONG>max_attributes</STRONG> <STRONG>ma</STRONG> <STRONG>ma</STRONG> maximum combined attributes |
| 340 | terminal can handle |
| 341 | <STRONG>maximum_windows</STRONG> <STRONG>wnum</STRONG> <STRONG>MW</STRONG> maximum number of definable |
| 342 | windows |
| 343 | <STRONG>max_colors</STRONG> <STRONG>colors</STRONG> <STRONG>Co</STRONG> maximum number of colors on |
| 344 | screen |
| 345 | <STRONG>max_pairs</STRONG> <STRONG>pairs</STRONG> <STRONG>pa</STRONG> maximum number of color-pairs |
| 346 | on the screen |
| 347 | <STRONG>no_color_video</STRONG> <STRONG>ncv</STRONG> <STRONG>NC</STRONG> video attributes that cannot |
| 348 | be used with colors |
| 349 | |
| 350 | The following numeric capabilities are present in the SVr4.0 term |
| 351 | structure, but are not yet documented in the man page. They came in |
| 352 | with SVr4's printer support. |
| 353 | |
| 354 | <STRONG>Code</STRONG> |
| 355 | <STRONG>Numeric</STRONG> <STRONG>Capability</STRONG> <STRONG>Name</STRONG> <STRONG>TI</STRONG> <STRONG>TC</STRONG> <STRONG>Description</STRONG> |
| 356 | ------------------------------------------------------------------------ |
| 357 | <STRONG>buffer_capacity</STRONG> <STRONG>bufsz</STRONG> <STRONG>Ya</STRONG> numbers of bytes buffered |
| 358 | before printing |
| 359 | <STRONG>dot_vert_spacing</STRONG> <STRONG>spinv</STRONG> <STRONG>Yb</STRONG> spacing of pins vertically in |
| 360 | pins per inch |
| 361 | <STRONG>dot_horz_spacing</STRONG> <STRONG>spinh</STRONG> <STRONG>Yc</STRONG> spacing of dots horizontally |
| 362 | in dots per inch |
| 363 | <STRONG>max_micro_address</STRONG> <STRONG>maddr</STRONG> <STRONG>Yd</STRONG> maximum value in |
| 364 | micro_..._address |
| 365 | <STRONG>max_micro_jump</STRONG> <STRONG>mjump</STRONG> <STRONG>Ye</STRONG> maximum value in |
| 366 | parm_..._micro |
| 367 | <STRONG>micro_col_size</STRONG> <STRONG>mcs</STRONG> <STRONG>Yf</STRONG> character step size when in |
| 368 | micro mode |
| 369 | <STRONG>micro_line_size</STRONG> <STRONG>mls</STRONG> <STRONG>Yg</STRONG> line step size when in micro |
| 370 | mode |
| 371 | <STRONG>number_of_pins</STRONG> <STRONG>npins</STRONG> <STRONG>Yh</STRONG> numbers of pins in print-head |
| 372 | <STRONG>output_res_char</STRONG> <STRONG>orc</STRONG> <STRONG>Yi</STRONG> horizontal resolution in units |
| 373 | per line |
| 374 | <STRONG>output_res_line</STRONG> <STRONG>orl</STRONG> <STRONG>Yj</STRONG> vertical resolution in units |
| 375 | per line |
| 376 | <STRONG>output_res_horz_inch</STRONG> <STRONG>orhi</STRONG> <STRONG>Yk</STRONG> horizontal resolution in units |
| 377 | per inch |
| 378 | <STRONG>output_res_vert_inch</STRONG> <STRONG>orvi</STRONG> <STRONG>Yl</STRONG> vertical resolution in units |
| 379 | per inch |
| 380 | <STRONG>print_rate</STRONG> <STRONG>cps</STRONG> <STRONG>Ym</STRONG> print rate in characters per |
| 381 | second |
| 382 | <STRONG>wide_char_size</STRONG> <STRONG>widcs</STRONG> <STRONG>Yn</STRONG> character step size when in |
| 383 | double wide mode |
| 384 | <STRONG>buttons</STRONG> <STRONG>btns</STRONG> <STRONG>BT</STRONG> number of buttons on mouse |
| 385 | |
| 386 | <STRONG>bit_image_entwining</STRONG> <STRONG>bitwin</STRONG> <STRONG>Yo</STRONG> number of passes for each bit- |
| 387 | image row |
| 388 | <STRONG>bit_image_type</STRONG> <STRONG>bitype</STRONG> <STRONG>Yp</STRONG> type of bit-image device |
| 389 | |
| 390 | <STRONG>Code</STRONG> |
| 391 | <STRONG>String</STRONG> <STRONG>Capability</STRONG> <STRONG>Name</STRONG> <STRONG>TI</STRONG> <STRONG>TC</STRONG> <STRONG>Description</STRONG> |
| 392 | ------------------------------------------------------------------------ |
| 393 | <STRONG>back_tab</STRONG> <STRONG>cbt</STRONG> <STRONG>bt</STRONG> back tab (P) |
| 394 | <STRONG>bell</STRONG> <STRONG>bel</STRONG> <STRONG>bl</STRONG> audible signal (bell) (P) |
| 395 | <STRONG>carriage_return</STRONG> <STRONG>cr</STRONG> <STRONG>cr</STRONG> carriage return (P*) (P*) |
| 396 | <STRONG>change_scroll_region</STRONG> <STRONG>csr</STRONG> <STRONG>cs</STRONG> change region to line #1 to |
| 397 | line #2 (P) |
| 398 | <STRONG>clear_all_tabs</STRONG> <STRONG>tbc</STRONG> <STRONG>ct</STRONG> clear all tab stops (P) |
| 399 | <STRONG>clear_screen</STRONG> <STRONG>clear</STRONG> <STRONG>cl</STRONG> clear screen and home cursor |
| 400 | (P*) |
| 401 | <STRONG>clr_eol</STRONG> <STRONG>el</STRONG> <STRONG>ce</STRONG> clear to end of line (P) |
| 402 | <STRONG>clr_eos</STRONG> <STRONG>ed</STRONG> <STRONG>cd</STRONG> clear to end of screen (P*) |
| 403 | <STRONG>column_address</STRONG> <STRONG>hpa</STRONG> <STRONG>ch</STRONG> horizontal position #1, |
| 404 | absolute (P) |
| 405 | <STRONG>command_character</STRONG> <STRONG>cmdch</STRONG> <STRONG>CC</STRONG> terminal settable cmd |
| 406 | character in prototype !? |
| 407 | <STRONG>cursor_address</STRONG> <STRONG>cup</STRONG> <STRONG>cm</STRONG> move to row #1 columns #2 |
| 408 | <STRONG>cursor_down</STRONG> <STRONG>cud1</STRONG> <STRONG>do</STRONG> down one line |
| 409 | <STRONG>cursor_home</STRONG> <STRONG>home</STRONG> <STRONG>ho</STRONG> home cursor (if no cup) |
| 410 | <STRONG>cursor_invisible</STRONG> <STRONG>civis</STRONG> <STRONG>vi</STRONG> make cursor invisible |
| 411 | <STRONG>cursor_left</STRONG> <STRONG>cub1</STRONG> <STRONG>le</STRONG> move left one space |
| 412 | <STRONG>cursor_mem_address</STRONG> <STRONG>mrcup</STRONG> <STRONG>CM</STRONG> memory relative cursor |
| 413 | addressing, move to row #1 |
| 414 | columns #2 |
| 415 | <STRONG>cursor_normal</STRONG> <STRONG>cnorm</STRONG> <STRONG>ve</STRONG> make cursor appear normal |
| 416 | (undo civis/cvvis) |
| 417 | <STRONG>cursor_right</STRONG> <STRONG>cuf1</STRONG> <STRONG>nd</STRONG> non-destructive space (move |
| 418 | right one space) |
| 419 | <STRONG>cursor_to_ll</STRONG> <STRONG>ll</STRONG> <STRONG>ll</STRONG> last line, first column (if no |
| 420 | cup) |
| 421 | <STRONG>cursor_up</STRONG> <STRONG>cuu1</STRONG> <STRONG>up</STRONG> up one line |
| 422 | <STRONG>cursor_visible</STRONG> <STRONG>cvvis</STRONG> <STRONG>vs</STRONG> make cursor very visible |
| 423 | <STRONG>delete_character</STRONG> <STRONG>dch1</STRONG> <STRONG>dc</STRONG> delete character (P*) |
| 424 | <STRONG>delete_line</STRONG> <STRONG>dl1</STRONG> <STRONG>dl</STRONG> delete line (P*) |
| 425 | <STRONG>dis_status_line</STRONG> <STRONG>dsl</STRONG> <STRONG>ds</STRONG> disable status line |
| 426 | <STRONG>down_half_line</STRONG> <STRONG>hd</STRONG> <STRONG>hd</STRONG> half a line down |
| 427 | <STRONG>enter_alt_charset_mode</STRONG> <STRONG>smacs</STRONG> <STRONG>as</STRONG> start alternate character set |
| 428 | (P) |
| 429 | <STRONG>enter_blink_mode</STRONG> <STRONG>blink</STRONG> <STRONG>mb</STRONG> turn on blinking |
| 430 | <STRONG>enter_bold_mode</STRONG> <STRONG>bold</STRONG> <STRONG>md</STRONG> turn on bold (extra bright) |
| 431 | mode |
| 432 | <STRONG>enter_ca_mode</STRONG> <STRONG>smcup</STRONG> <STRONG>ti</STRONG> string to start programs using |
| 433 | cup |
| 434 | <STRONG>enter_delete_mode</STRONG> <STRONG>smdc</STRONG> <STRONG>dm</STRONG> enter delete mode |
| 435 | <STRONG>enter_dim_mode</STRONG> <STRONG>dim</STRONG> <STRONG>mh</STRONG> turn on half-bright mode |
| 436 | <STRONG>enter_insert_mode</STRONG> <STRONG>smir</STRONG> <STRONG>im</STRONG> enter insert mode |
| 437 | <STRONG>enter_secure_mode</STRONG> <STRONG>invis</STRONG> <STRONG>mk</STRONG> turn on blank mode (characters |
| 438 | invisible) |
| 439 | <STRONG>enter_protected_mode</STRONG> <STRONG>prot</STRONG> <STRONG>mp</STRONG> turn on protected mode |
| 440 | <STRONG>enter_reverse_mode</STRONG> <STRONG>rev</STRONG> <STRONG>mr</STRONG> turn on reverse video mode |
| 441 | <STRONG>enter_standout_mode</STRONG> <STRONG>smso</STRONG> <STRONG>so</STRONG> begin standout mode |
| 442 | <STRONG>enter_underline_mode</STRONG> <STRONG>smul</STRONG> <STRONG>us</STRONG> begin underline mode |
| 443 | <STRONG>erase_chars</STRONG> <STRONG>ech</STRONG> <STRONG>ec</STRONG> erase #1 characters (P) |
| 444 | <STRONG>exit_alt_charset_mode</STRONG> <STRONG>rmacs</STRONG> <STRONG>ae</STRONG> end alternate character set |
| 445 | (P) |
| 446 | <STRONG>exit_attribute_mode</STRONG> <STRONG>sgr0</STRONG> <STRONG>me</STRONG> turn off all attributes |
| 447 | <STRONG>exit_ca_mode</STRONG> <STRONG>rmcup</STRONG> <STRONG>te</STRONG> strings to end programs using |
| 448 | cup |
| 449 | <STRONG>exit_delete_mode</STRONG> <STRONG>rmdc</STRONG> <STRONG>ed</STRONG> end delete mode |
| 450 | <STRONG>exit_insert_mode</STRONG> <STRONG>rmir</STRONG> <STRONG>ei</STRONG> exit insert mode |
| 451 | |
| 452 | <STRONG>exit_standout_mode</STRONG> <STRONG>rmso</STRONG> <STRONG>se</STRONG> exit standout mode |
| 453 | <STRONG>exit_underline_mode</STRONG> <STRONG>rmul</STRONG> <STRONG>ue</STRONG> exit underline mode |
| 454 | <STRONG>flash_screen</STRONG> <STRONG>flash</STRONG> <STRONG>vb</STRONG> visible bell (may not move |
| 455 | cursor) |
| 456 | <STRONG>form_feed</STRONG> <STRONG>ff</STRONG> <STRONG>ff</STRONG> hardcopy terminal page eject |
| 457 | (P*) |
| 458 | <STRONG>from_status_line</STRONG> <STRONG>fsl</STRONG> <STRONG>fs</STRONG> return from status line |
| 459 | <STRONG>init_1string</STRONG> <STRONG>is1</STRONG> <STRONG>i1</STRONG> initialization string |
| 460 | <STRONG>init_2string</STRONG> <STRONG>is2</STRONG> <STRONG>is</STRONG> initialization string |
| 461 | <STRONG>init_3string</STRONG> <STRONG>is3</STRONG> <STRONG>i3</STRONG> initialization string |
| 462 | <STRONG>init_file</STRONG> <STRONG>if</STRONG> <STRONG>if</STRONG> name of initialization file |
| 463 | <STRONG>insert_character</STRONG> <STRONG>ich1</STRONG> <STRONG>ic</STRONG> insert character (P) |
| 464 | <STRONG>insert_line</STRONG> <STRONG>il1</STRONG> <STRONG>al</STRONG> insert line (P*) |
| 465 | <STRONG>insert_padding</STRONG> <STRONG>ip</STRONG> <STRONG>ip</STRONG> insert padding after inserted |
| 466 | character |
| 467 | <STRONG>key_backspace</STRONG> <STRONG>kbs</STRONG> <STRONG>kb</STRONG> backspace key |
| 468 | <STRONG>key_catab</STRONG> <STRONG>ktbc</STRONG> <STRONG>ka</STRONG> clear-all-tabs key |
| 469 | <STRONG>key_clear</STRONG> <STRONG>kclr</STRONG> <STRONG>kC</STRONG> clear-screen or erase key |
| 470 | <STRONG>key_ctab</STRONG> <STRONG>kctab</STRONG> <STRONG>kt</STRONG> clear-tab key |
| 471 | <STRONG>key_dc</STRONG> <STRONG>kdch1</STRONG> <STRONG>kD</STRONG> delete-character key |
| 472 | <STRONG>key_dl</STRONG> <STRONG>kdl1</STRONG> <STRONG>kL</STRONG> delete-line key |
| 473 | <STRONG>key_down</STRONG> <STRONG>kcud1</STRONG> <STRONG>kd</STRONG> down-arrow key |
| 474 | |
| 475 | <STRONG>key_eic</STRONG> <STRONG>krmir</STRONG> <STRONG>kM</STRONG> sent by rmir or smir in insert |
| 476 | mode |
| 477 | <STRONG>key_eol</STRONG> <STRONG>kel</STRONG> <STRONG>kE</STRONG> clear-to-end-of-line key |
| 478 | <STRONG>key_eos</STRONG> <STRONG>ked</STRONG> <STRONG>kS</STRONG> clear-to-end-of-screen key |
| 479 | <STRONG>key_f0</STRONG> <STRONG>kf0</STRONG> <STRONG>k0</STRONG> F0 function key |
| 480 | <STRONG>key_f1</STRONG> <STRONG>kf1</STRONG> <STRONG>k1</STRONG> F1 function key |
| 481 | <STRONG>key_f10</STRONG> <STRONG>kf10</STRONG> <STRONG>k;</STRONG> F10 function key |
| 482 | <STRONG>key_f2</STRONG> <STRONG>kf2</STRONG> <STRONG>k2</STRONG> F2 function key |
| 483 | <STRONG>key_f3</STRONG> <STRONG>kf3</STRONG> <STRONG>k3</STRONG> F3 function key |
| 484 | <STRONG>key_f4</STRONG> <STRONG>kf4</STRONG> <STRONG>k4</STRONG> F4 function key |
| 485 | <STRONG>key_f5</STRONG> <STRONG>kf5</STRONG> <STRONG>k5</STRONG> F5 function key |
| 486 | <STRONG>key_f6</STRONG> <STRONG>kf6</STRONG> <STRONG>k6</STRONG> F6 function key |
| 487 | <STRONG>key_f7</STRONG> <STRONG>kf7</STRONG> <STRONG>k7</STRONG> F7 function key |
| 488 | <STRONG>key_f8</STRONG> <STRONG>kf8</STRONG> <STRONG>k8</STRONG> F8 function key |
| 489 | <STRONG>key_f9</STRONG> <STRONG>kf9</STRONG> <STRONG>k9</STRONG> F9 function key |
| 490 | <STRONG>key_home</STRONG> <STRONG>khome</STRONG> <STRONG>kh</STRONG> home key |
| 491 | <STRONG>key_ic</STRONG> <STRONG>kich1</STRONG> <STRONG>kI</STRONG> insert-character key |
| 492 | <STRONG>key_il</STRONG> <STRONG>kil1</STRONG> <STRONG>kA</STRONG> insert-line key |
| 493 | <STRONG>key_left</STRONG> <STRONG>kcub1</STRONG> <STRONG>kl</STRONG> left-arrow key |
| 494 | <STRONG>key_ll</STRONG> <STRONG>kll</STRONG> <STRONG>kH</STRONG> lower-left key (home down) |
| 495 | <STRONG>key_npage</STRONG> <STRONG>knp</STRONG> <STRONG>kN</STRONG> next-page key |
| 496 | <STRONG>key_ppage</STRONG> <STRONG>kpp</STRONG> <STRONG>kP</STRONG> previous-page key |
| 497 | <STRONG>key_right</STRONG> <STRONG>kcuf1</STRONG> <STRONG>kr</STRONG> right-arrow key |
| 498 | <STRONG>key_sf</STRONG> <STRONG>kind</STRONG> <STRONG>kF</STRONG> scroll-forward key |
| 499 | <STRONG>key_sr</STRONG> <STRONG>kri</STRONG> <STRONG>kR</STRONG> scroll-backward key |
| 500 | <STRONG>key_stab</STRONG> <STRONG>khts</STRONG> <STRONG>kT</STRONG> set-tab key |
| 501 | <STRONG>key_up</STRONG> <STRONG>kcuu1</STRONG> <STRONG>ku</STRONG> up-arrow key |
| 502 | <STRONG>keypad_local</STRONG> <STRONG>rmkx</STRONG> <STRONG>ke</STRONG> leave keyboard transmit mode |
| 503 | <STRONG>keypad_xmit</STRONG> <STRONG>smkx</STRONG> <STRONG>ks</STRONG> enter keyboard transmit mode |
| 504 | <STRONG>lab_f0</STRONG> <STRONG>lf0</STRONG> <STRONG>l0</STRONG> label on function key f0 if |
| 505 | not f0 |
| 506 | <STRONG>lab_f1</STRONG> <STRONG>lf1</STRONG> <STRONG>l1</STRONG> label on function key f1 if |
| 507 | not f1 |
| 508 | <STRONG>lab_f10</STRONG> <STRONG>lf10</STRONG> <STRONG>la</STRONG> label on function key f10 if |
| 509 | not f10 |
| 510 | <STRONG>lab_f2</STRONG> <STRONG>lf2</STRONG> <STRONG>l2</STRONG> label on function key f2 if |
| 511 | not f2 |
| 512 | <STRONG>lab_f3</STRONG> <STRONG>lf3</STRONG> <STRONG>l3</STRONG> label on function key f3 if |
| 513 | not f3 |
| 514 | <STRONG>lab_f4</STRONG> <STRONG>lf4</STRONG> <STRONG>l4</STRONG> label on function key f4 if |
| 515 | not f4 |
| 516 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 517 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 518 | <STRONG>lab_f5</STRONG> <STRONG>lf5</STRONG> <STRONG>l5</STRONG> label on function key f5 if |
| 519 | not f5 |
| 520 | <STRONG>lab_f6</STRONG> <STRONG>lf6</STRONG> <STRONG>l6</STRONG> label on function key f6 if |
| 521 | not f6 |
| 522 | <STRONG>lab_f7</STRONG> <STRONG>lf7</STRONG> <STRONG>l7</STRONG> label on function key f7 if |
| 523 | not f7 |
| 524 | <STRONG>lab_f8</STRONG> <STRONG>lf8</STRONG> <STRONG>l8</STRONG> label on function key f8 if |
| 525 | not f8 |
| 526 | <STRONG>lab_f9</STRONG> <STRONG>lf9</STRONG> <STRONG>l9</STRONG> label on function key f9 if |
| 527 | not f9 |
| 528 | <STRONG>meta_off</STRONG> <STRONG>rmm</STRONG> <STRONG>mo</STRONG> turn off meta mode |
| 529 | <STRONG>meta_on</STRONG> <STRONG>smm</STRONG> <STRONG>mm</STRONG> turn on meta mode (8th-bit on) |
| 530 | <STRONG>newline</STRONG> <STRONG>nel</STRONG> <STRONG>nw</STRONG> newline (behave like cr |
| 531 | followed by lf) |
| 532 | <STRONG>pad_char</STRONG> <STRONG>pad</STRONG> <STRONG>pc</STRONG> padding char (instead of null) |
| 533 | <STRONG>parm_dch</STRONG> <STRONG>dch</STRONG> <STRONG>DC</STRONG> delete #1 characters (P*) |
| 534 | <STRONG>parm_delete_line</STRONG> <STRONG>dl</STRONG> <STRONG>DL</STRONG> delete #1 lines (P*) |
| 535 | <STRONG>parm_down_cursor</STRONG> <STRONG>cud</STRONG> <STRONG>DO</STRONG> down #1 lines (P*) |
| 536 | <STRONG>parm_ich</STRONG> <STRONG>ich</STRONG> <STRONG>IC</STRONG> insert #1 characters (P*) |
| 537 | <STRONG>parm_index</STRONG> <STRONG>indn</STRONG> <STRONG>SF</STRONG> scroll forward #1 lines (P) |
| 538 | <STRONG>parm_insert_line</STRONG> <STRONG>il</STRONG> <STRONG>AL</STRONG> insert #1 lines (P*) |
| 539 | <STRONG>parm_left_cursor</STRONG> <STRONG>cub</STRONG> <STRONG>LE</STRONG> move #1 characters to the left |
| 540 | (P) |
| 541 | <STRONG>parm_right_cursor</STRONG> <STRONG>cuf</STRONG> <STRONG>RI</STRONG> move #1 characters to the |
| 542 | right (P*) |
| 543 | <STRONG>parm_rindex</STRONG> <STRONG>rin</STRONG> <STRONG>SR</STRONG> scroll back #1 lines (P) |
| 544 | <STRONG>parm_up_cursor</STRONG> <STRONG>cuu</STRONG> <STRONG>UP</STRONG> up #1 lines (P*) |
| 545 | <STRONG>pkey_key</STRONG> <STRONG>pfkey</STRONG> <STRONG>pk</STRONG> program function key #1 to |
| 546 | type string #2 |
| 547 | <STRONG>pkey_local</STRONG> <STRONG>pfloc</STRONG> <STRONG>pl</STRONG> program function key #1 to |
| 548 | execute string #2 |
| 549 | <STRONG>pkey_xmit</STRONG> <STRONG>pfx</STRONG> <STRONG>px</STRONG> program function key #1 to |
| 550 | transmit string #2 |
| 551 | <STRONG>print_screen</STRONG> <STRONG>mc0</STRONG> <STRONG>ps</STRONG> print contents of screen |
| 552 | <STRONG>prtr_off</STRONG> <STRONG>mc4</STRONG> <STRONG>pf</STRONG> turn off printer |
| 553 | <STRONG>prtr_on</STRONG> <STRONG>mc5</STRONG> <STRONG>po</STRONG> turn on printer |
| 554 | <STRONG>repeat_char</STRONG> <STRONG>rep</STRONG> <STRONG>rp</STRONG> repeat char #1 #2 times (P*) |
| 555 | <STRONG>reset_1string</STRONG> <STRONG>rs1</STRONG> <STRONG>r1</STRONG> reset string |
| 556 | <STRONG>reset_2string</STRONG> <STRONG>rs2</STRONG> <STRONG>r2</STRONG> reset string |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 557 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 558 | <STRONG>reset_3string</STRONG> <STRONG>rs3</STRONG> <STRONG>r3</STRONG> reset string |
| 559 | <STRONG>reset_file</STRONG> <STRONG>rf</STRONG> <STRONG>rf</STRONG> name of reset file |
| 560 | <STRONG>restore_cursor</STRONG> <STRONG>rc</STRONG> <STRONG>rc</STRONG> restore cursor to position of |
| 561 | last save_cursor |
| 562 | <STRONG>row_address</STRONG> <STRONG>vpa</STRONG> <STRONG>cv</STRONG> vertical position #1 absolute |
| 563 | (P) |
| 564 | <STRONG>save_cursor</STRONG> <STRONG>sc</STRONG> <STRONG>sc</STRONG> save current cursor position |
| 565 | (P) |
| 566 | <STRONG>scroll_forward</STRONG> <STRONG>ind</STRONG> <STRONG>sf</STRONG> scroll text up (P) |
| 567 | <STRONG>scroll_reverse</STRONG> <STRONG>ri</STRONG> <STRONG>sr</STRONG> scroll text down (P) |
| 568 | <STRONG>set_attributes</STRONG> <STRONG>sgr</STRONG> <STRONG>sa</STRONG> define video attributes #1-#9 |
| 569 | (PG9) |
| 570 | <STRONG>set_tab</STRONG> <STRONG>hts</STRONG> <STRONG>st</STRONG> set a tab in every row, |
| 571 | current columns |
| 572 | <STRONG>set_window</STRONG> <STRONG>wind</STRONG> <STRONG>wi</STRONG> current window is lines #1-#2 |
| 573 | cols #3-#4 |
| 574 | <STRONG>tab</STRONG> <STRONG>ht</STRONG> <STRONG>ta</STRONG> tab to next 8-space hardware |
| 575 | tab stop |
| 576 | <STRONG>to_status_line</STRONG> <STRONG>tsl</STRONG> <STRONG>ts</STRONG> move to status line, column #1 |
| 577 | <STRONG>underline_char</STRONG> <STRONG>uc</STRONG> <STRONG>uc</STRONG> underline char and move past |
| 578 | it |
| 579 | <STRONG>up_half_line</STRONG> <STRONG>hu</STRONG> <STRONG>hu</STRONG> half a line up |
| 580 | <STRONG>init_prog</STRONG> <STRONG>iprog</STRONG> <STRONG>iP</STRONG> path name of program for |
| 581 | initialization |
| 582 | <STRONG>key_a1</STRONG> <STRONG>ka1</STRONG> <STRONG>K1</STRONG> upper left of keypad |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 583 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 584 | <STRONG>key_a3</STRONG> <STRONG>ka3</STRONG> <STRONG>K3</STRONG> upper right of keypad |
| 585 | <STRONG>key_b2</STRONG> <STRONG>kb2</STRONG> <STRONG>K2</STRONG> center of keypad |
| 586 | <STRONG>key_c1</STRONG> <STRONG>kc1</STRONG> <STRONG>K4</STRONG> lower left of keypad |
| 587 | <STRONG>key_c3</STRONG> <STRONG>kc3</STRONG> <STRONG>K5</STRONG> lower right of keypad |
| 588 | <STRONG>prtr_non</STRONG> <STRONG>mc5p</STRONG> <STRONG>pO</STRONG> turn on printer for #1 bytes |
| 589 | <STRONG>char_padding</STRONG> <STRONG>rmp</STRONG> <STRONG>rP</STRONG> like ip but when in insert |
| 590 | mode |
| 591 | <STRONG>acs_chars</STRONG> <STRONG>acsc</STRONG> <STRONG>ac</STRONG> graphics charset pairs, based |
| 592 | on vt100 |
| 593 | <STRONG>plab_norm</STRONG> <STRONG>pln</STRONG> <STRONG>pn</STRONG> program label #1 to show |
| 594 | string #2 |
| 595 | <STRONG>key_btab</STRONG> <STRONG>kcbt</STRONG> <STRONG>kB</STRONG> back-tab key |
| 596 | <STRONG>enter_xon_mode</STRONG> <STRONG>smxon</STRONG> <STRONG>SX</STRONG> turn on xon/xoff handshaking |
| 597 | <STRONG>exit_xon_mode</STRONG> <STRONG>rmxon</STRONG> <STRONG>RX</STRONG> turn off xon/xoff handshaking |
| 598 | <STRONG>enter_am_mode</STRONG> <STRONG>smam</STRONG> <STRONG>SA</STRONG> turn on automatic margins |
| 599 | <STRONG>exit_am_mode</STRONG> <STRONG>rmam</STRONG> <STRONG>RA</STRONG> turn off automatic margins |
| 600 | <STRONG>xon_character</STRONG> <STRONG>xonc</STRONG> <STRONG>XN</STRONG> XON character |
| 601 | <STRONG>xoff_character</STRONG> <STRONG>xoffc</STRONG> <STRONG>XF</STRONG> XOFF character |
| 602 | <STRONG>ena_acs</STRONG> <STRONG>enacs</STRONG> <STRONG>eA</STRONG> enable alternate char set |
| 603 | <STRONG>label_on</STRONG> <STRONG>smln</STRONG> <STRONG>LO</STRONG> turn on soft labels |
| 604 | <STRONG>label_off</STRONG> <STRONG>rmln</STRONG> <STRONG>LF</STRONG> turn off soft labels |
| 605 | <STRONG>key_beg</STRONG> <STRONG>kbeg</STRONG> <STRONG>@1</STRONG> begin key |
| 606 | <STRONG>key_cancel</STRONG> <STRONG>kcan</STRONG> <STRONG>@2</STRONG> cancel key |
| 607 | <STRONG>key_close</STRONG> <STRONG>kclo</STRONG> <STRONG>@3</STRONG> close key |
| 608 | <STRONG>key_command</STRONG> <STRONG>kcmd</STRONG> <STRONG>@4</STRONG> command key |
| 609 | <STRONG>key_copy</STRONG> <STRONG>kcpy</STRONG> <STRONG>@5</STRONG> copy key |
| 610 | <STRONG>key_create</STRONG> <STRONG>kcrt</STRONG> <STRONG>@6</STRONG> create key |
| 611 | <STRONG>key_end</STRONG> <STRONG>kend</STRONG> <STRONG>@7</STRONG> end key |
| 612 | <STRONG>key_enter</STRONG> <STRONG>kent</STRONG> <STRONG>@8</STRONG> enter/send key |
| 613 | <STRONG>key_exit</STRONG> <STRONG>kext</STRONG> <STRONG>@9</STRONG> exit key |
| 614 | <STRONG>key_find</STRONG> <STRONG>kfnd</STRONG> <STRONG>@0</STRONG> find key |
| 615 | <STRONG>key_help</STRONG> <STRONG>khlp</STRONG> <STRONG>%1</STRONG> help key |
| 616 | <STRONG>key_mark</STRONG> <STRONG>kmrk</STRONG> <STRONG>%2</STRONG> mark key |
| 617 | <STRONG>key_message</STRONG> <STRONG>kmsg</STRONG> <STRONG>%3</STRONG> message key |
| 618 | <STRONG>key_move</STRONG> <STRONG>kmov</STRONG> <STRONG>%4</STRONG> move key |
| 619 | <STRONG>key_next</STRONG> <STRONG>knxt</STRONG> <STRONG>%5</STRONG> next key |
| 620 | <STRONG>key_open</STRONG> <STRONG>kopn</STRONG> <STRONG>%6</STRONG> open key |
| 621 | <STRONG>key_options</STRONG> <STRONG>kopt</STRONG> <STRONG>%7</STRONG> options key |
| 622 | <STRONG>key_previous</STRONG> <STRONG>kprv</STRONG> <STRONG>%8</STRONG> previous key |
| 623 | <STRONG>key_print</STRONG> <STRONG>kprt</STRONG> <STRONG>%9</STRONG> print key |
| 624 | <STRONG>key_redo</STRONG> <STRONG>krdo</STRONG> <STRONG>%0</STRONG> redo key |
| 625 | <STRONG>key_reference</STRONG> <STRONG>kref</STRONG> <STRONG>&1</STRONG> reference key |
| 626 | <STRONG>key_refresh</STRONG> <STRONG>krfr</STRONG> <STRONG>&2</STRONG> refresh key |
| 627 | <STRONG>key_replace</STRONG> <STRONG>krpl</STRONG> <STRONG>&3</STRONG> replace key |
| 628 | <STRONG>key_restart</STRONG> <STRONG>krst</STRONG> <STRONG>&4</STRONG> restart key |
| 629 | <STRONG>key_resume</STRONG> <STRONG>kres</STRONG> <STRONG>&5</STRONG> resume key |
| 630 | <STRONG>key_save</STRONG> <STRONG>ksav</STRONG> <STRONG>&6</STRONG> save key |
| 631 | <STRONG>key_suspend</STRONG> <STRONG>kspd</STRONG> <STRONG>&7</STRONG> suspend key |
| 632 | <STRONG>key_undo</STRONG> <STRONG>kund</STRONG> <STRONG>&8</STRONG> undo key |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 633 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 634 | <STRONG>key_sbeg</STRONG> <STRONG>kBEG</STRONG> <STRONG>&9</STRONG> shifted begin key |
| 635 | <STRONG>key_scancel</STRONG> <STRONG>kCAN</STRONG> <STRONG>&0</STRONG> shifted cancel key |
| 636 | <STRONG>key_scommand</STRONG> <STRONG>kCMD</STRONG> <STRONG>*1</STRONG> shifted command key |
| 637 | <STRONG>key_scopy</STRONG> <STRONG>kCPY</STRONG> <STRONG>*2</STRONG> shifted copy key |
| 638 | <STRONG>key_screate</STRONG> <STRONG>kCRT</STRONG> <STRONG>*3</STRONG> shifted create key |
| 639 | <STRONG>key_sdc</STRONG> <STRONG>kDC</STRONG> <STRONG>*4</STRONG> shifted delete-character key |
| 640 | <STRONG>key_sdl</STRONG> <STRONG>kDL</STRONG> <STRONG>*5</STRONG> shifted delete-line key |
| 641 | <STRONG>key_select</STRONG> <STRONG>kslt</STRONG> <STRONG>*6</STRONG> select key |
| 642 | <STRONG>key_send</STRONG> <STRONG>kEND</STRONG> <STRONG>*7</STRONG> shifted end key |
| 643 | <STRONG>key_seol</STRONG> <STRONG>kEOL</STRONG> <STRONG>*8</STRONG> shifted clear-to-end-of-line |
| 644 | key |
| 645 | <STRONG>key_sexit</STRONG> <STRONG>kEXT</STRONG> <STRONG>*9</STRONG> shifted exit key |
| 646 | <STRONG>key_sfind</STRONG> <STRONG>kFND</STRONG> <STRONG>*0</STRONG> shifted find key |
| 647 | <STRONG>key_shelp</STRONG> <STRONG>kHLP</STRONG> <STRONG>#1</STRONG> shifted help key |
| 648 | <STRONG>key_shome</STRONG> <STRONG>kHOM</STRONG> <STRONG>#2</STRONG> shifted home key |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 649 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 650 | <STRONG>key_sic</STRONG> <STRONG>kIC</STRONG> <STRONG>#3</STRONG> shifted insert-character key |
| 651 | <STRONG>key_sleft</STRONG> <STRONG>kLFT</STRONG> <STRONG>#4</STRONG> shifted left-arrow key |
| 652 | <STRONG>key_smessage</STRONG> <STRONG>kMSG</STRONG> <STRONG>%a</STRONG> shifted message key |
| 653 | <STRONG>key_smove</STRONG> <STRONG>kMOV</STRONG> <STRONG>%b</STRONG> shifted move key |
| 654 | <STRONG>key_snext</STRONG> <STRONG>kNXT</STRONG> <STRONG>%c</STRONG> shifted next key |
| 655 | <STRONG>key_soptions</STRONG> <STRONG>kOPT</STRONG> <STRONG>%d</STRONG> shifted options key |
| 656 | <STRONG>key_sprevious</STRONG> <STRONG>kPRV</STRONG> <STRONG>%e</STRONG> shifted previous key |
| 657 | <STRONG>key_sprint</STRONG> <STRONG>kPRT</STRONG> <STRONG>%f</STRONG> shifted print key |
| 658 | <STRONG>key_sredo</STRONG> <STRONG>kRDO</STRONG> <STRONG>%g</STRONG> shifted redo key |
| 659 | <STRONG>key_sreplace</STRONG> <STRONG>kRPL</STRONG> <STRONG>%h</STRONG> shifted replace key |
| 660 | <STRONG>key_sright</STRONG> <STRONG>kRIT</STRONG> <STRONG>%i</STRONG> shifted right-arrow key |
| 661 | <STRONG>key_srsume</STRONG> <STRONG>kRES</STRONG> <STRONG>%j</STRONG> shifted resume key |
| 662 | <STRONG>key_ssave</STRONG> <STRONG>kSAV</STRONG> <STRONG>!1</STRONG> shifted save key |
| 663 | <STRONG>key_ssuspend</STRONG> <STRONG>kSPD</STRONG> <STRONG>!2</STRONG> shifted suspend key |
| 664 | <STRONG>key_sundo</STRONG> <STRONG>kUND</STRONG> <STRONG>!3</STRONG> shifted undo key |
| 665 | <STRONG>req_for_input</STRONG> <STRONG>rfi</STRONG> <STRONG>RF</STRONG> send next input char (for |
| 666 | ptys) |
| 667 | <STRONG>key_f11</STRONG> <STRONG>kf11</STRONG> <STRONG>F1</STRONG> F11 function key |
| 668 | <STRONG>key_f12</STRONG> <STRONG>kf12</STRONG> <STRONG>F2</STRONG> F12 function key |
| 669 | <STRONG>key_f13</STRONG> <STRONG>kf13</STRONG> <STRONG>F3</STRONG> F13 function key |
| 670 | <STRONG>key_f14</STRONG> <STRONG>kf14</STRONG> <STRONG>F4</STRONG> F14 function key |
| 671 | <STRONG>key_f15</STRONG> <STRONG>kf15</STRONG> <STRONG>F5</STRONG> F15 function key |
| 672 | <STRONG>key_f16</STRONG> <STRONG>kf16</STRONG> <STRONG>F6</STRONG> F16 function key |
| 673 | <STRONG>key_f17</STRONG> <STRONG>kf17</STRONG> <STRONG>F7</STRONG> F17 function key |
| 674 | <STRONG>key_f18</STRONG> <STRONG>kf18</STRONG> <STRONG>F8</STRONG> F18 function key |
| 675 | <STRONG>key_f19</STRONG> <STRONG>kf19</STRONG> <STRONG>F9</STRONG> F19 function key |
| 676 | <STRONG>key_f20</STRONG> <STRONG>kf20</STRONG> <STRONG>FA</STRONG> F20 function key |
| 677 | <STRONG>key_f21</STRONG> <STRONG>kf21</STRONG> <STRONG>FB</STRONG> F21 function key |
| 678 | <STRONG>key_f22</STRONG> <STRONG>kf22</STRONG> <STRONG>FC</STRONG> F22 function key |
| 679 | <STRONG>key_f23</STRONG> <STRONG>kf23</STRONG> <STRONG>FD</STRONG> F23 function key |
| 680 | <STRONG>key_f24</STRONG> <STRONG>kf24</STRONG> <STRONG>FE</STRONG> F24 function key |
| 681 | <STRONG>key_f25</STRONG> <STRONG>kf25</STRONG> <STRONG>FF</STRONG> F25 function key |
| 682 | <STRONG>key_f26</STRONG> <STRONG>kf26</STRONG> <STRONG>FG</STRONG> F26 function key |
| 683 | <STRONG>key_f27</STRONG> <STRONG>kf27</STRONG> <STRONG>FH</STRONG> F27 function key |
| 684 | <STRONG>key_f28</STRONG> <STRONG>kf28</STRONG> <STRONG>FI</STRONG> F28 function key |
| 685 | <STRONG>key_f29</STRONG> <STRONG>kf29</STRONG> <STRONG>FJ</STRONG> F29 function key |
| 686 | <STRONG>key_f30</STRONG> <STRONG>kf30</STRONG> <STRONG>FK</STRONG> F30 function key |
| 687 | <STRONG>key_f31</STRONG> <STRONG>kf31</STRONG> <STRONG>FL</STRONG> F31 function key |
| 688 | <STRONG>key_f32</STRONG> <STRONG>kf32</STRONG> <STRONG>FM</STRONG> F32 function key |
| 689 | <STRONG>key_f33</STRONG> <STRONG>kf33</STRONG> <STRONG>FN</STRONG> F33 function key |
| 690 | <STRONG>key_f34</STRONG> <STRONG>kf34</STRONG> <STRONG>FO</STRONG> F34 function key |
| 691 | <STRONG>key_f35</STRONG> <STRONG>kf35</STRONG> <STRONG>FP</STRONG> F35 function key |
| 692 | <STRONG>key_f36</STRONG> <STRONG>kf36</STRONG> <STRONG>FQ</STRONG> F36 function key |
| 693 | <STRONG>key_f37</STRONG> <STRONG>kf37</STRONG> <STRONG>FR</STRONG> F37 function key |
| 694 | <STRONG>key_f38</STRONG> <STRONG>kf38</STRONG> <STRONG>FS</STRONG> F38 function key |
| 695 | <STRONG>key_f39</STRONG> <STRONG>kf39</STRONG> <STRONG>FT</STRONG> F39 function key |
| 696 | <STRONG>key_f40</STRONG> <STRONG>kf40</STRONG> <STRONG>FU</STRONG> F40 function key |
| 697 | <STRONG>key_f41</STRONG> <STRONG>kf41</STRONG> <STRONG>FV</STRONG> F41 function key |
| 698 | <STRONG>key_f42</STRONG> <STRONG>kf42</STRONG> <STRONG>FW</STRONG> F42 function key |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 699 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 700 | <STRONG>key_f43</STRONG> <STRONG>kf43</STRONG> <STRONG>FX</STRONG> F43 function key |
| 701 | <STRONG>key_f44</STRONG> <STRONG>kf44</STRONG> <STRONG>FY</STRONG> F44 function key |
| 702 | <STRONG>key_f45</STRONG> <STRONG>kf45</STRONG> <STRONG>FZ</STRONG> F45 function key |
| 703 | <STRONG>key_f46</STRONG> <STRONG>kf46</STRONG> <STRONG>Fa</STRONG> F46 function key |
| 704 | <STRONG>key_f47</STRONG> <STRONG>kf47</STRONG> <STRONG>Fb</STRONG> F47 function key |
| 705 | <STRONG>key_f48</STRONG> <STRONG>kf48</STRONG> <STRONG>Fc</STRONG> F48 function key |
| 706 | <STRONG>key_f49</STRONG> <STRONG>kf49</STRONG> <STRONG>Fd</STRONG> F49 function key |
| 707 | <STRONG>key_f50</STRONG> <STRONG>kf50</STRONG> <STRONG>Fe</STRONG> F50 function key |
| 708 | <STRONG>key_f51</STRONG> <STRONG>kf51</STRONG> <STRONG>Ff</STRONG> F51 function key |
| 709 | <STRONG>key_f52</STRONG> <STRONG>kf52</STRONG> <STRONG>Fg</STRONG> F52 function key |
| 710 | <STRONG>key_f53</STRONG> <STRONG>kf53</STRONG> <STRONG>Fh</STRONG> F53 function key |
| 711 | <STRONG>key_f54</STRONG> <STRONG>kf54</STRONG> <STRONG>Fi</STRONG> F54 function key |
| 712 | <STRONG>key_f55</STRONG> <STRONG>kf55</STRONG> <STRONG>Fj</STRONG> F55 function key |
| 713 | <STRONG>key_f56</STRONG> <STRONG>kf56</STRONG> <STRONG>Fk</STRONG> F56 function key |
| 714 | <STRONG>key_f57</STRONG> <STRONG>kf57</STRONG> <STRONG>Fl</STRONG> F57 function key |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 715 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 716 | <STRONG>key_f58</STRONG> <STRONG>kf58</STRONG> <STRONG>Fm</STRONG> F58 function key |
| 717 | <STRONG>key_f59</STRONG> <STRONG>kf59</STRONG> <STRONG>Fn</STRONG> F59 function key |
| 718 | <STRONG>key_f60</STRONG> <STRONG>kf60</STRONG> <STRONG>Fo</STRONG> F60 function key |
| 719 | <STRONG>key_f61</STRONG> <STRONG>kf61</STRONG> <STRONG>Fp</STRONG> F61 function key |
| 720 | <STRONG>key_f62</STRONG> <STRONG>kf62</STRONG> <STRONG>Fq</STRONG> F62 function key |
| 721 | <STRONG>key_f63</STRONG> <STRONG>kf63</STRONG> <STRONG>Fr</STRONG> F63 function key |
| 722 | <STRONG>clr_bol</STRONG> <STRONG>el1</STRONG> <STRONG>cb</STRONG> Clear to beginning of line |
| 723 | <STRONG>clear_margins</STRONG> <STRONG>mgc</STRONG> <STRONG>MC</STRONG> clear right and left soft |
| 724 | margins |
| 725 | <STRONG>set_left_margin</STRONG> <STRONG>smgl</STRONG> <STRONG>ML</STRONG> set left soft margin at |
| 726 | current column (not in BSD |
| 727 | <EM>termcap</EM>) |
| 728 | <STRONG>set_right_margin</STRONG> <STRONG>smgr</STRONG> <STRONG>MR</STRONG> set right soft margin at |
| 729 | current column |
| 730 | <STRONG>label_format</STRONG> <STRONG>fln</STRONG> <STRONG>Lf</STRONG> label format |
| 731 | <STRONG>set_clock</STRONG> <STRONG>sclk</STRONG> <STRONG>SC</STRONG> set clock, #1 hrs #2 mins #3 |
| 732 | secs |
| 733 | <STRONG>display_clock</STRONG> <STRONG>dclk</STRONG> <STRONG>DK</STRONG> display clock |
| 734 | <STRONG>remove_clock</STRONG> <STRONG>rmclk</STRONG> <STRONG>RC</STRONG> remove clock |
| 735 | <STRONG>create_window</STRONG> <STRONG>cwin</STRONG> <STRONG>CW</STRONG> define a window #1 from #2,#3 |
| 736 | to #4,#5 |
| 737 | <STRONG>goto_window</STRONG> <STRONG>wingo</STRONG> <STRONG>WG</STRONG> go to window #1 |
| 738 | <STRONG>hangup</STRONG> <STRONG>hup</STRONG> <STRONG>HU</STRONG> hang-up phone |
| 739 | <STRONG>dial_phone</STRONG> <STRONG>dial</STRONG> <STRONG>DI</STRONG> dial number #1 |
| 740 | <STRONG>quick_dial</STRONG> <STRONG>qdial</STRONG> <STRONG>QD</STRONG> dial number #1 without |
| 741 | checking |
| 742 | <STRONG>tone</STRONG> <STRONG>tone</STRONG> <STRONG>TO</STRONG> select touch tone dialing |
| 743 | <STRONG>pulse</STRONG> <STRONG>pulse</STRONG> <STRONG>PU</STRONG> select pulse dialing |
| 744 | <STRONG>flash_hook</STRONG> <STRONG>hook</STRONG> <STRONG>fh</STRONG> flash switch hook |
| 745 | <STRONG>fixed_pause</STRONG> <STRONG>pause</STRONG> <STRONG>PA</STRONG> pause for 2-3 seconds |
| 746 | <STRONG>wait_tone</STRONG> <STRONG>wait</STRONG> <STRONG>WA</STRONG> wait for dial-tone |
| 747 | <STRONG>user0</STRONG> <STRONG>u0</STRONG> <STRONG>u0</STRONG> User string #0 |
| 748 | <STRONG>user1</STRONG> <STRONG>u1</STRONG> <STRONG>u1</STRONG> User string #1 |
| 749 | <STRONG>user2</STRONG> <STRONG>u2</STRONG> <STRONG>u2</STRONG> User string #2 |
| 750 | <STRONG>user3</STRONG> <STRONG>u3</STRONG> <STRONG>u3</STRONG> User string #3 |
| 751 | <STRONG>user4</STRONG> <STRONG>u4</STRONG> <STRONG>u4</STRONG> User string #4 |
| 752 | <STRONG>user5</STRONG> <STRONG>u5</STRONG> <STRONG>u5</STRONG> User string #5 |
| 753 | <STRONG>user6</STRONG> <STRONG>u6</STRONG> <STRONG>u6</STRONG> User string #6 |
| 754 | <STRONG>user7</STRONG> <STRONG>u7</STRONG> <STRONG>u7</STRONG> User string #7 |
| 755 | <STRONG>user8</STRONG> <STRONG>u8</STRONG> <STRONG>u8</STRONG> User string #8 |
| 756 | <STRONG>user9</STRONG> <STRONG>u9</STRONG> <STRONG>u9</STRONG> User string #9 |
| 757 | <STRONG>orig_pair</STRONG> <STRONG>op</STRONG> <STRONG>op</STRONG> Set default pair to its |
| 758 | original value |
| 759 | <STRONG>orig_colors</STRONG> <STRONG>oc</STRONG> <STRONG>oc</STRONG> Set all color pairs to the |
| 760 | original ones |
| 761 | <STRONG>initialize_color</STRONG> <STRONG>initc</STRONG> <STRONG>Ic</STRONG> initialize color #1 to |
| 762 | (#2,#3,#4) |
| 763 | <STRONG>initialize_pair</STRONG> <STRONG>initp</STRONG> <STRONG>Ip</STRONG> Initialize color pair #1 to |
| 764 | fg=(#2,#3,#4), bg=(#5,#6,#7) |
| 765 | <STRONG>set_color_pair</STRONG> <STRONG>scp</STRONG> <STRONG>sp</STRONG> Set current color pair to #1 |
| 766 | <STRONG>set_foreground</STRONG> <STRONG>setf</STRONG> <STRONG>Sf</STRONG> Set foreground color #1 |
| 767 | <STRONG>set_background</STRONG> <STRONG>setb</STRONG> <STRONG>Sb</STRONG> Set background color #1 |
| 768 | <STRONG>change_char_pitch</STRONG> <STRONG>cpi</STRONG> <STRONG>ZA</STRONG> Change number of characters |
| 769 | per inch to #1 |
| 770 | <STRONG>change_line_pitch</STRONG> <STRONG>lpi</STRONG> <STRONG>ZB</STRONG> Change number of lines per |
| 771 | inch to #1 |
| 772 | <STRONG>change_res_horz</STRONG> <STRONG>chr</STRONG> <STRONG>ZC</STRONG> Change horizontal resolution |
| 773 | to #1 |
| 774 | <STRONG>change_res_vert</STRONG> <STRONG>cvr</STRONG> <STRONG>ZD</STRONG> Change vertical resolution to |
| 775 | #1 |
| 776 | <STRONG>define_char</STRONG> <STRONG>defc</STRONG> <STRONG>ZE</STRONG> Define a character #1, #2 dots |
| 777 | wide, descender #3 |
| 778 | <STRONG>enter_doublewide_mode</STRONG> <STRONG>swidm</STRONG> <STRONG>ZF</STRONG> Enter double-wide mode |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 779 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 780 | <STRONG>enter_draft_quality</STRONG> <STRONG>sdrfq</STRONG> <STRONG>ZG</STRONG> Enter draft-quality mode |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 781 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 782 | <STRONG>enter_italics_mode</STRONG> <STRONG>sitm</STRONG> <STRONG>ZH</STRONG> Enter italic mode |
| 783 | <STRONG>enter_leftward_mode</STRONG> <STRONG>slm</STRONG> <STRONG>ZI</STRONG> Start leftward carriage motion |
| 784 | <STRONG>enter_micro_mode</STRONG> <STRONG>smicm</STRONG> <STRONG>ZJ</STRONG> Start micro-motion mode |
| 785 | <STRONG>enter_near_letter_quality</STRONG> <STRONG>snlq</STRONG> <STRONG>ZK</STRONG> Enter NLQ mode |
| 786 | <STRONG>enter_normal_quality</STRONG> <STRONG>snrmq</STRONG> <STRONG>ZL</STRONG> Enter normal-quality mode |
| 787 | <STRONG>enter_shadow_mode</STRONG> <STRONG>sshm</STRONG> <STRONG>ZM</STRONG> Enter shadow-print mode |
| 788 | <STRONG>enter_subscript_mode</STRONG> <STRONG>ssubm</STRONG> <STRONG>ZN</STRONG> Enter subscript mode |
| 789 | <STRONG>enter_superscript_mode</STRONG> <STRONG>ssupm</STRONG> <STRONG>ZO</STRONG> Enter superscript mode |
| 790 | <STRONG>enter_upward_mode</STRONG> <STRONG>sum</STRONG> <STRONG>ZP</STRONG> Start upward carriage motion |
| 791 | <STRONG>exit_doublewide_mode</STRONG> <STRONG>rwidm</STRONG> <STRONG>ZQ</STRONG> End double-wide mode |
| 792 | <STRONG>exit_italics_mode</STRONG> <STRONG>ritm</STRONG> <STRONG>ZR</STRONG> End italic mode |
| 793 | <STRONG>exit_leftward_mode</STRONG> <STRONG>rlm</STRONG> <STRONG>ZS</STRONG> End left-motion mode |
| 794 | <STRONG>exit_micro_mode</STRONG> <STRONG>rmicm</STRONG> <STRONG>ZT</STRONG> End micro-motion mode |
| 795 | <STRONG>exit_shadow_mode</STRONG> <STRONG>rshm</STRONG> <STRONG>ZU</STRONG> End shadow-print mode |
| 796 | <STRONG>exit_subscript_mode</STRONG> <STRONG>rsubm</STRONG> <STRONG>ZV</STRONG> End subscript mode |
| 797 | <STRONG>exit_superscript_mode</STRONG> <STRONG>rsupm</STRONG> <STRONG>ZW</STRONG> End superscript mode |
| 798 | <STRONG>exit_upward_mode</STRONG> <STRONG>rum</STRONG> <STRONG>ZX</STRONG> End reverse character motion |
| 799 | <STRONG>micro_column_address</STRONG> <STRONG>mhpa</STRONG> <STRONG>ZY</STRONG> Like column_address in micro |
| 800 | mode |
| 801 | <STRONG>micro_down</STRONG> <STRONG>mcud1</STRONG> <STRONG>ZZ</STRONG> Like cursor_down in micro mode |
| 802 | <STRONG>micro_left</STRONG> <STRONG>mcub1</STRONG> <STRONG>Za</STRONG> Like cursor_left in micro mode |
| 803 | <STRONG>micro_right</STRONG> <STRONG>mcuf1</STRONG> <STRONG>Zb</STRONG> Like cursor_right in micro |
| 804 | mode |
| 805 | <STRONG>micro_row_address</STRONG> <STRONG>mvpa</STRONG> <STRONG>Zc</STRONG> Like row_address #1 in micro |
| 806 | mode |
| 807 | <STRONG>micro_up</STRONG> <STRONG>mcuu1</STRONG> <STRONG>Zd</STRONG> Like cursor_up in micro mode |
| 808 | <STRONG>order_of_pins</STRONG> <STRONG>porder</STRONG> <STRONG>Ze</STRONG> Match software bits to print- |
| 809 | head pins |
| 810 | <STRONG>parm_down_micro</STRONG> <STRONG>mcud</STRONG> <STRONG>Zf</STRONG> Like parm_down_cursor in micro |
| 811 | mode |
| 812 | <STRONG>parm_left_micro</STRONG> <STRONG>mcub</STRONG> <STRONG>Zg</STRONG> Like parm_left_cursor in micro |
| 813 | mode |
| 814 | <STRONG>parm_right_micro</STRONG> <STRONG>mcuf</STRONG> <STRONG>Zh</STRONG> Like parm_right_cursor in |
| 815 | micro mode |
| 816 | <STRONG>parm_up_micro</STRONG> <STRONG>mcuu</STRONG> <STRONG>Zi</STRONG> Like parm_up_cursor in micro |
| 817 | mode |
| 818 | <STRONG>select_char_set</STRONG> <STRONG>scs</STRONG> <STRONG>Zj</STRONG> Select character set, #1 |
| 819 | <STRONG>set_bottom_margin</STRONG> <STRONG>smgb</STRONG> <STRONG>Zk</STRONG> Set bottom margin at current |
| 820 | line |
| 821 | <STRONG>set_bottom_margin_parm</STRONG> <STRONG>smgbp</STRONG> <STRONG>Zl</STRONG> Set bottom margin at line #1 |
| 822 | or (if smgtp is not given) #2 |
| 823 | lines from bottom |
| 824 | <STRONG>set_left_margin_parm</STRONG> <STRONG>smglp</STRONG> <STRONG>Zm</STRONG> Set left (right) margin at |
| 825 | column #1 |
| 826 | <STRONG>set_right_margin_parm</STRONG> <STRONG>smgrp</STRONG> <STRONG>Zn</STRONG> Set right margin at column #1 |
| 827 | <STRONG>set_top_margin</STRONG> <STRONG>smgt</STRONG> <STRONG>Zo</STRONG> Set top margin at current line |
| 828 | <STRONG>set_top_margin_parm</STRONG> <STRONG>smgtp</STRONG> <STRONG>Zp</STRONG> Set top (bottom) margin at row |
| 829 | #1 |
| 830 | <STRONG>start_bit_image</STRONG> <STRONG>sbim</STRONG> <STRONG>Zq</STRONG> Start printing bit image |
| 831 | graphics |
| 832 | <STRONG>start_char_set_def</STRONG> <STRONG>scsd</STRONG> <STRONG>Zr</STRONG> Start character set definition |
| 833 | #1, with #2 characters in the |
| 834 | set |
| 835 | <STRONG>stop_bit_image</STRONG> <STRONG>rbim</STRONG> <STRONG>Zs</STRONG> Stop printing bit image |
| 836 | graphics |
| 837 | <STRONG>stop_char_set_def</STRONG> <STRONG>rcsd</STRONG> <STRONG>Zt</STRONG> End definition of character |
| 838 | set #1 |
| 839 | <STRONG>subscript_characters</STRONG> <STRONG>subcs</STRONG> <STRONG>Zu</STRONG> List of subscriptable |
| 840 | characters |
| 841 | <STRONG>superscript_characters</STRONG> <STRONG>supcs</STRONG> <STRONG>Zv</STRONG> List of superscriptable |
| 842 | characters |
| 843 | <STRONG>these_cause_cr</STRONG> <STRONG>docr</STRONG> <STRONG>Zw</STRONG> Printing any of these |
| 844 | characters causes CR |
| 845 | <STRONG>zero_motion</STRONG> <STRONG>zerom</STRONG> <STRONG>Zx</STRONG> No motion for subsequent |
| 846 | character |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 847 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 848 | The following string capabilities are present in the SVr4.0 term |
| 849 | structure, but were originally not documented in the man page. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 850 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 851 | <STRONG>Code</STRONG> |
| 852 | <STRONG>String</STRONG> <STRONG>Capability</STRONG> <STRONG>Name</STRONG> <STRONG>TI</STRONG> <STRONG>TC</STRONG> <STRONG>Description</STRONG> |
| 853 | ------------------------------------------------------------------------ |
| 854 | <STRONG>char_set_names</STRONG> <STRONG>csnm</STRONG> <STRONG>Zy</STRONG> Produce #1'th item from list |
| 855 | of character set names |
| 856 | <STRONG>key_mouse</STRONG> <STRONG>kmous</STRONG> <STRONG>Km</STRONG> Mouse event has occurred |
| 857 | <STRONG>mouse_info</STRONG> <STRONG>minfo</STRONG> <STRONG>Mi</STRONG> Mouse status information |
| 858 | <STRONG>req_mouse_pos</STRONG> <STRONG>reqmp</STRONG> <STRONG>RQ</STRONG> Request mouse position |
| 859 | <STRONG>get_mouse</STRONG> <STRONG>getm</STRONG> <STRONG>Gm</STRONG> Curses should get button |
| 860 | events, parameter #1 not |
| 861 | documented. |
| 862 | <STRONG>set_a_foreground</STRONG> <STRONG>setaf</STRONG> <STRONG>AF</STRONG> Set foreground color to #1, |
| 863 | using ANSI escape |
| 864 | <STRONG>set_a_background</STRONG> <STRONG>setab</STRONG> <STRONG>AB</STRONG> Set background color to #1, |
| 865 | using ANSI escape |
| 866 | <STRONG>pkey_plab</STRONG> <STRONG>pfxl</STRONG> <STRONG>xl</STRONG> Program function key #1 to |
| 867 | type string #2 and show string |
| 868 | #3 |
| 869 | <STRONG>device_type</STRONG> <STRONG>devt</STRONG> <STRONG>dv</STRONG> Indicate language, codeset |
| 870 | support |
| 871 | <STRONG>code_set_init</STRONG> <STRONG>csin</STRONG> <STRONG>ci</STRONG> Init sequence for multiple |
| 872 | codesets |
| 873 | <STRONG>set0_des_seq</STRONG> <STRONG>s0ds</STRONG> <STRONG>s0</STRONG> Shift to codeset 0 (EUC set 0, |
| 874 | ASCII) |
| 875 | <STRONG>set1_des_seq</STRONG> <STRONG>s1ds</STRONG> <STRONG>s1</STRONG> Shift to codeset 1 |
| 876 | <STRONG>set2_des_seq</STRONG> <STRONG>s2ds</STRONG> <STRONG>s2</STRONG> Shift to codeset 2 |
| 877 | <STRONG>set3_des_seq</STRONG> <STRONG>s3ds</STRONG> <STRONG>s3</STRONG> Shift to codeset 3 |
| 878 | <STRONG>set_lr_margin</STRONG> <STRONG>smglr</STRONG> <STRONG>ML</STRONG> Set both left and right |
| 879 | margins to #1, #2. (ML is not |
| 880 | in BSD termcap). |
| 881 | <STRONG>set_tb_margin</STRONG> <STRONG>smgtb</STRONG> <STRONG>MT</STRONG> Sets both top and bottom |
| 882 | margins to #1, #2 |
| 883 | <STRONG>bit_image_repeat</STRONG> <STRONG>birep</STRONG> <STRONG>Xy</STRONG> Repeat bit image cell #1 #2 |
| 884 | times |
| 885 | <STRONG>bit_image_newline</STRONG> <STRONG>binel</STRONG> <STRONG>Zz</STRONG> Move to next row of the bit |
| 886 | image |
| 887 | <STRONG>bit_image_carriage_return</STRONG> <STRONG>bicr</STRONG> <STRONG>Yv</STRONG> Move to beginning of same row |
| 888 | <STRONG>color_names</STRONG> <STRONG>colornm</STRONG> <STRONG>Yw</STRONG> Give name for color #1 |
| 889 | <STRONG>define_bit_image_region</STRONG> <STRONG>defbi</STRONG> <STRONG>Yx</STRONG> Define rectangular bit image |
| 890 | region |
| 891 | <STRONG>end_bit_image_region</STRONG> <STRONG>endbi</STRONG> <STRONG>Yy</STRONG> End a bit-image region |
| 892 | <STRONG>set_color_band</STRONG> <STRONG>setcolor</STRONG> <STRONG>Yz</STRONG> Change to ribbon color #1 |
| 893 | <STRONG>set_page_length</STRONG> <STRONG>slines</STRONG> <STRONG>YZ</STRONG> Set page length to #1 lines |
| 894 | <STRONG>display_pc_char</STRONG> <STRONG>dispc</STRONG> <STRONG>S1</STRONG> Display PC character #1 |
| 895 | <STRONG>enter_pc_charset_mode</STRONG> <STRONG>smpch</STRONG> <STRONG>S2</STRONG> Enter PC character display |
| 896 | mode |
| 897 | <STRONG>exit_pc_charset_mode</STRONG> <STRONG>rmpch</STRONG> <STRONG>S3</STRONG> Exit PC character display mode |
| 898 | <STRONG>enter_scancode_mode</STRONG> <STRONG>smsc</STRONG> <STRONG>S4</STRONG> Enter PC scancode mode |
| 899 | <STRONG>exit_scancode_mode</STRONG> <STRONG>rmsc</STRONG> <STRONG>S5</STRONG> Exit PC scancode mode |
| 900 | <STRONG>pc_term_options</STRONG> <STRONG>pctrm</STRONG> <STRONG>S6</STRONG> PC terminal options |
| 901 | <STRONG>scancode_escape</STRONG> <STRONG>scesc</STRONG> <STRONG>S7</STRONG> Escape for scancode emulation |
| 902 | <STRONG>alt_scancode_esc</STRONG> <STRONG>scesa</STRONG> <STRONG>S8</STRONG> Alternate escape for scancode |
| 903 | emulation |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 904 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 905 | The XSI Curses standard added these hardcopy capabilities. They were |
| 906 | used in some post-4.1 versions of System V curses, e.g., Solaris 2.5 |
| 907 | and IRIX 6.x. Except for <STRONG>YI</STRONG>, the <STRONG>ncurses</STRONG> termcap names for them are |
| 908 | invented. According to the XSI Curses standard, they have no termcap |
| 909 | names. If your compiled terminfo entries use these, they may not be |
| 910 | binary-compatible with System V terminfo entries after SVr4.1; beware! |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 911 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 912 | <STRONG>Code</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 913 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 914 | <STRONG>String</STRONG> <STRONG>Capability</STRONG> <STRONG>Name</STRONG> <STRONG>TI</STRONG> <STRONG>TC</STRONG> <STRONG>Description</STRONG> |
| 915 | ------------------------------------------------------------------------ |
| 916 | <STRONG>enter_horizontal_hl_mode</STRONG> <STRONG>ehhlm</STRONG> <STRONG>Xh</STRONG> Enter horizontal highlight |
| 917 | mode |
| 918 | <STRONG>enter_left_hl_mode</STRONG> <STRONG>elhlm</STRONG> <STRONG>Xl</STRONG> Enter left highlight mode |
| 919 | <STRONG>enter_low_hl_mode</STRONG> <STRONG>elohlm</STRONG> <STRONG>Xo</STRONG> Enter low highlight mode |
| 920 | <STRONG>enter_right_hl_mode</STRONG> <STRONG>erhlm</STRONG> <STRONG>Xr</STRONG> Enter right highlight mode |
| 921 | <STRONG>enter_top_hl_mode</STRONG> <STRONG>ethlm</STRONG> <STRONG>Xt</STRONG> Enter top highlight mode |
| 922 | <STRONG>enter_vertical_hl_mode</STRONG> <STRONG>evhlm</STRONG> <STRONG>Xv</STRONG> Enter vertical highlight mode |
| 923 | <STRONG>set_a_attributes</STRONG> <STRONG>sgr1</STRONG> <STRONG>sA</STRONG> Define second set of video |
| 924 | attributes #1-#6 |
| 925 | <STRONG>set_pglen_inch</STRONG> <STRONG>slength</STRONG> <STRONG>YI</STRONG> Set page length to #1 |
| 926 | hundredth of an inch (some |
| 927 | implementations use sL for |
| 928 | termcap). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 929 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 930 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 931 | </PRE><H3><a name="h3-User-Defined-Capabilities">User-Defined Capabilities</a></H3><PRE> |
| 932 | The preceding section listed the <EM>predefined</EM> capabilities. They deal |
| 933 | with some special features for terminals no longer (or possibly never) |
| 934 | produced. Occasionally there are special features of newer terminals |
| 935 | which are awkward or impossible to represent by reusing the predefined |
| 936 | capabilities. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 937 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 938 | <EM>ncurses</EM> addresses this limitation by allowing user-defined |
| 939 | capabilities. The <STRONG>tic</STRONG> and <STRONG>infocmp</STRONG> programs provide the <STRONG>-x</STRONG> option for |
| 940 | this purpose. When <STRONG>-x</STRONG> is set, <STRONG>tic</STRONG> treats unknown capabilities as user- |
| 941 | defined. That is, if <STRONG>tic</STRONG> encounters a capability name which it does |
| 942 | not recognize, it infers its type (Boolean, number or string) from the |
| 943 | syntax and makes an extended table entry for that capability. The |
| 944 | <STRONG><A HREF="curs_extend.3x.html">use_extended_names(3x)</A></STRONG> function makes this information conditionally |
| 945 | available to applications. The <EM>ncurses</EM> library provides the data |
| 946 | leaving most of the behavior to applications: |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 947 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 948 | <STRONG>o</STRONG> User-defined capability strings whose name begins with "k" are |
| 949 | treated as function keys. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 950 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 951 | <STRONG>o</STRONG> The types (Boolean, number, string) determined by <STRONG>tic</STRONG> can be |
| 952 | inferred by successful calls on <STRONG>tigetflag</STRONG>, etc. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 953 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 954 | <STRONG>o</STRONG> If the capability name happens to be two characters, the capability |
| 955 | is also available through the termcap interface. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 956 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 957 | While termcap is said to be extensible because it does not use a |
| 958 | predefined set of capabilities, in practice it has been limited to the |
| 959 | capabilities defined by terminfo implementations. As a rule, user- |
| 960 | defined capabilities intended for use by termcap applications should be |
| 961 | limited to Booleans and numbers to avoid running past the 1023 byte |
| 962 | limit assumed by termcap implementations and their applications. In |
| 963 | particular, providing extended sets of function keys (past the 60 |
| 964 | numbered keys and the handful of special named keys) is best done using |
| 965 | the longer names available using terminfo. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 966 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 967 | The <EM>ncurses</EM> library uses a few of these user-defined capabilities, as |
| 968 | described in <STRONG><A HREF="user_caps.5.html">user_caps(5)</A></STRONG>. Other user-defined capabilities (including |
| 969 | function keys) are described in the terminal database, in the section |
| 970 | on <EM>NCURSES</EM> <EM>USER-DEFINABLE</EM> <EM>CAPABILITIES</EM> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 971 | |
| 972 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 973 | </PRE><H3><a name="h3-A-Sample-Entry">A Sample Entry</a></H3><PRE> |
| 974 | The following entry, describing an ANSI-standard terminal, is |
| 975 | representative of what a <STRONG>terminfo</STRONG> entry for a modern terminal typically |
| 976 | looks like. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 977 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 978 | ansi|ansi/pc-term compatible with color, |
| 979 | am, mc5i, mir, msgr, |
| 980 | colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64, |
| 981 | acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260 |
| 982 | j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303 |
| 983 | u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, |
| 984 | bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, |
| 985 | cr=^M, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B, |
| 986 | cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, |
| 987 | cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, |
| 988 | dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, |
| 989 | el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, ht=\E[I, hts=\EH, |
| 990 | ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=^J, |
| 991 | indn=\E[%p1%dS, invis=\E[8m, kbs=^H, kcbt=\E[Z, kcub1=\E[D, |
| 992 | kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, kich1=\E[L, |
| 993 | mc4=\E[4i, mc5=\E[5i, nel=\r\E[S, op=\E[39;49m, |
| 994 | rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, rin=\E[%p1%dT, |
| 995 | rmacs=\E[10m, rmpch=\E[10m, rmso=\E[m, rmul=\E[m, |
| 996 | s0ds=\E(B, s1ds=\E)B, s2ds=\E*B, s3ds=\E+B, |
| 997 | setab=\E[4%p1%dm, setaf=\E[3%p1%dm, |
| 998 | sgr=\E[0;10%?%p1%t;7%; |
| 999 | %?%p2%t;4%; |
| 1000 | %?%p3%t;7%; |
| 1001 | %?%p4%t;5%; |
| 1002 | %?%p6%t;1%; |
| 1003 | %?%p7%t;8%; |
| 1004 | %?%p9%t;11%;m, |
| 1005 | sgr0=\E[0;10m, smacs=\E[11m, smpch=\E[11m, smso=\E[7m, |
| 1006 | smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, |
| 1007 | u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%i%p1%dd, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1008 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1009 | Entries may continue onto multiple lines by placing white space at the |
| 1010 | beginning of each line except the first. Comments may be included on |
| 1011 | lines beginning with "#". Capabilities in <EM>terminfo</EM> are of three types: |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1012 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1013 | <STRONG>o</STRONG> Boolean capabilities which indicate that the terminal has some |
| 1014 | particular feature, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1015 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1016 | <STRONG>o</STRONG> numeric capabilities giving the size of the terminal or the size of |
| 1017 | particular delays, and |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1018 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1019 | <STRONG>o</STRONG> string capabilities, which give a sequence which can be used to |
| 1020 | perform particular terminal operations. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1021 | |
| 1022 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1023 | </PRE><H3><a name="h3-Types-of-Capabilities">Types of Capabilities</a></H3><PRE> |
| 1024 | All capabilities have names. For instance, the fact that ANSI-standard |
| 1025 | terminals have <EM>automatic</EM> <EM>margins</EM> (i.e., an automatic return and line- |
| 1026 | feed when the end of a line is reached) is indicated by the capability |
| 1027 | <STRONG>am</STRONG>. Hence the description of ansi includes <STRONG>am</STRONG>. Numeric capabilities |
| 1028 | are followed by the character "#" and then a positive value. Thus |
| 1029 | <STRONG>cols</STRONG>, which indicates the number of columns the terminal has, gives the |
| 1030 | value "80" for ansi. Values for numeric capabilities may be specified |
| 1031 | in decimal, octal, or hexadecimal, using the C programming language |
| 1032 | conventions (e.g., 255, 0377 and 0xff or 0xFF). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1033 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1034 | Finally, string valued capabilities, such as <STRONG>el</STRONG> (clear to end of line |
| 1035 | sequence) are given by the two-character code, an "=", and then a |
| 1036 | string ending at the next following ",". |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1037 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1038 | A number of escape sequences are provided in the string valued |
| 1039 | capabilities for easy encoding of characters there: |
| 1040 | |
| 1041 | <STRONG>o</STRONG> Both <STRONG>\E</STRONG> and <STRONG>\e</STRONG> map to an ESCAPE character, |
| 1042 | |
| 1043 | <STRONG>o</STRONG> <STRONG>^</STRONG><STRONG><EM>x</EM></STRONG> maps to a control-<EM>x</EM> for any appropriate <EM>x</EM>, and |
| 1044 | |
| 1045 | <STRONG>o</STRONG> the sequences |
| 1046 | |
| 1047 | <STRONG>\n</STRONG>, <STRONG>\l</STRONG>, <STRONG>\r</STRONG>, <STRONG>\t</STRONG>, <STRONG>\b</STRONG>, <STRONG>\f</STRONG>, and <STRONG>\s</STRONG> |
| 1048 | |
| 1049 | produce |
| 1050 | |
| 1051 | <EM>newline</EM>, <EM>line-feed</EM>, <EM>return</EM>, <EM>tab</EM>, <EM>backspace</EM>, <EM>form-feed</EM>, and <EM>space</EM>, |
| 1052 | |
| 1053 | respectively. |
| 1054 | |
| 1055 | X/Open Curses does not say what "appropriate <EM>x</EM>" might be. In practice, |
| 1056 | that is a printable ASCII graphic character. The special case "^?" is |
| 1057 | interpreted as DEL (127). In all other cases, the character value is |
| 1058 | AND'd with 0x1f, mapping to ASCII control codes in the range 0 through |
| 1059 | 31. |
| 1060 | |
| 1061 | Other escapes include |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1062 | |
| 1063 | <STRONG>o</STRONG> <STRONG>\^</STRONG> for <STRONG>^</STRONG>, |
| 1064 | |
| 1065 | <STRONG>o</STRONG> <STRONG>\\</STRONG> for <STRONG>\</STRONG>, |
| 1066 | |
| 1067 | <STRONG>o</STRONG> <STRONG>\</STRONG>, for comma, |
| 1068 | |
| 1069 | <STRONG>o</STRONG> <STRONG>\:</STRONG> for <STRONG>:</STRONG>, |
| 1070 | |
| 1071 | <STRONG>o</STRONG> and <STRONG>\0</STRONG> for null. |
| 1072 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1073 | <STRONG>\0</STRONG> will produce \200, which does not terminate a string but behaves |
| 1074 | as a null character on most terminals, providing CS7 is specified. |
| 1075 | See <STRONG>stty(1)</STRONG>. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1076 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1077 | The reason for this quirk is to maintain binary compatibility of |
| 1078 | the compiled terminfo files with other implementations, e.g., the |
| 1079 | SVr4 systems, which document this. Compiled terminfo files use |
| 1080 | null-terminated strings, with no lengths. Modifying this would |
| 1081 | require a new binary format, which would not work with other |
| 1082 | implementations. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1083 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1084 | Finally, characters may be given as three octal digits after a <STRONG>\</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1085 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1086 | A delay in milliseconds may appear anywhere in a string capability, |
| 1087 | enclosed in $<..> brackets, as in <STRONG>el</STRONG>=\EK$<5>, and padding characters |
| 1088 | are supplied by <STRONG><A HREF="curs_terminfo.3x.html">tputs(3x)</A></STRONG> to provide this delay. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1089 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1090 | <STRONG>o</STRONG> The delay must be a number with at most one decimal place of |
| 1091 | precision; it may be followed by suffixes "*" or "/" or both. |
| 1092 | |
| 1093 | <STRONG>o</STRONG> A "*" indicates that the padding required is proportional to the |
| 1094 | number of lines affected by the operation, and the amount given is |
| 1095 | the per-affected-unit padding required. (In the case of insert |
| 1096 | character, the factor is still the number of <EM>lines</EM> affected.) |
| 1097 | |
| 1098 | Normally, padding is advisory if the device has the <STRONG>xon</STRONG> capability; |
| 1099 | it is used for cost computation but does not trigger delays. |
| 1100 | |
| 1101 | <STRONG>o</STRONG> A "/" suffix indicates that the padding is mandatory and forces a |
| 1102 | delay of the given number of milliseconds even on devices for which |
| 1103 | <STRONG>xon</STRONG> is present to indicate flow control. |
| 1104 | |
| 1105 | Sometimes individual capabilities must be commented out. To do this, |
| 1106 | put a period before the capability name. For example, see the second |
| 1107 | <STRONG>ind</STRONG> in the example above. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1108 | |
| 1109 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1110 | </PRE><H3><a name="h3-Fetching-Compiled-Descriptions">Fetching Compiled Descriptions</a></H3><PRE> |
| 1111 | Terminal descriptions in <EM>ncurses</EM> are stored in terminal databases. |
| 1112 | These databases, which are found by their pathname, may be configured |
| 1113 | either as directory trees or hashed databases (see <STRONG><A HREF="term.5.html">term(5)</A></STRONG>), |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1114 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1115 | The library uses a compiled-in list of pathnames, which can be |
| 1116 | overridden by environment variables. Before starting to search, |
| 1117 | <EM>ncurses</EM> checks the search list, eliminating duplicates and pathnames |
| 1118 | where no terminal database is found. The <EM>ncurses</EM> library reads the |
| 1119 | first description which passes its consistency checks. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1120 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1121 | <STRONG>o</STRONG> The environment variable <STRONG>TERMINFO</STRONG> is checked first, for a terminal |
| 1122 | database containing the terminal description. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1123 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1124 | <STRONG>o</STRONG> Next, <EM>ncurses</EM> looks in <EM>$HOME/.terminfo</EM> for a compiled description. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1125 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1126 | This is an optional feature which may be omitted entirely from the |
| 1127 | library, or limited to prevent accidental use by privileged |
| 1128 | applications. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1129 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1130 | <STRONG>o</STRONG> Next, if the environment variable <EM>TERMINFO</EM><STRONG>_</STRONG><EM>DIRS</EM> is set, <EM>ncurses</EM> |
| 1131 | interprets the contents of that variable as a list of colon- |
| 1132 | separated pathnames of terminal databases to be searched. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1133 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1134 | An empty pathname (i.e., if the variable begins or ends with a |
| 1135 | colon, or contains adjacent colons) is interpreted as the system |
| 1136 | location <EM>/usr/share/terminfo</EM>. |
| 1137 | |
| 1138 | <STRONG>o</STRONG> Finally, <EM>ncurses</EM> searches these compiled-in locations: |
| 1139 | |
| 1140 | <STRONG>o</STRONG> a list of directories (/usr/share/terminfo), and |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1141 | |
| 1142 | <STRONG>o</STRONG> the system terminfo directory, <EM>/usr/share/terminfo</EM> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1143 | |
| 1144 | The <STRONG>TERMINFO</STRONG> variable can contain a terminal description instead of the |
| 1145 | pathname of a terminal database. If this variable begins with "hex:" |
| 1146 | or "b64:" then <EM>ncurses</EM> reads a terminal description from hexadecimal- |
| 1147 | or base64-encoded data, and if that description matches the name |
| 1148 | sought, will use that. This encoded data can be set using the "-Q" |
| 1149 | option of <STRONG>tic</STRONG> or <STRONG>infocmp</STRONG>. |
| 1150 | |
| 1151 | The preceding addresses the usual configuration of <EM>ncurses</EM>, which uses |
| 1152 | terminal descriptions prepared in <EM>terminfo</EM> format. While <EM>termcap</EM> is |
| 1153 | less expressive, <EM>ncurses</EM> can also be configured to read <EM>termcap</EM> |
| 1154 | descriptions. In that configuration, it checks the <EM>TERMCAP</EM> and |
| 1155 | <EM>TERMPATH</EM> variables (for content and search path, respectively) after |
| 1156 | the system terminal database. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1157 | |
| 1158 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1159 | </PRE><H3><a name="h3-Preparing-Descriptions">Preparing Descriptions</a></H3><PRE> |
| 1160 | We now outline how to prepare descriptions of terminals. The most |
| 1161 | effective way to prepare a terminal description is by imitating the |
| 1162 | description of a similar terminal in <EM>terminfo</EM> and to build up a |
| 1163 | description gradually, using partial descriptions with <EM>vi</EM> or some other |
| 1164 | screen-oriented program to check that they are correct. Be aware that |
| 1165 | a very unusual terminal may expose deficiencies in the ability of the |
| 1166 | <EM>terminfo</EM> file to describe it or bugs in the screen-handling code of the |
| 1167 | test program. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1168 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1169 | To get the padding for insert line right (if the terminal manufacturer |
| 1170 | did not document it) a severe test is to edit a large file at 9600 |
| 1171 | baud, delete 16 or so lines from the middle of the screen, then hit the |
| 1172 | "u" key several times quickly. If the terminal messes up, more padding |
| 1173 | is usually needed. A similar test can be used for insert character. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1174 | |
| 1175 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1176 | </PRE><H3><a name="h3-Basic-Capabilities">Basic Capabilities</a></H3><PRE> |
| 1177 | The number of columns on each line for the terminal is given by the |
| 1178 | <STRONG>cols</STRONG> numeric capability. If the terminal is a CRT, then the number of |
| 1179 | lines on the screen is given by the <STRONG>lines</STRONG> capability. If the terminal |
| 1180 | wraps around to the beginning of the next line when it reaches the |
| 1181 | right margin, then it should have the <STRONG>am</STRONG> capability. If the terminal |
| 1182 | can clear its screen, leaving the cursor in the home position, then |
| 1183 | this is given by the <STRONG>clear</STRONG> string capability. If the terminal |
| 1184 | overstrikes (rather than clearing a position when a character is struck |
| 1185 | over) then it should have the <STRONG>os</STRONG> capability. If the terminal is a |
| 1186 | printing terminal, with no soft copy unit, give it both <STRONG>hc</STRONG> and <STRONG>os</STRONG>. (<STRONG>os</STRONG> |
| 1187 | applies to storage scope terminals, such as TEKTRONIX 4010 series, as |
| 1188 | well as hard copy and APL terminals.) If there is a code to move the |
| 1189 | cursor to the left edge of the current row, give this as <STRONG>cr</STRONG>. (Normally |
| 1190 | this will be carriage return, control/M.) If there is a code to |
| 1191 | produce an audible signal (bell, beep, etc) give this as <STRONG>bel</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1192 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1193 | If there is a code to move the cursor one position to the left (such as |
| 1194 | backspace) that capability should be given as <STRONG>cub1</STRONG>. Similarly, codes |
| 1195 | to move to the right, up, and down should be given as <STRONG>cuf1</STRONG>, <STRONG>cuu1</STRONG>, and |
| 1196 | <STRONG>cud1</STRONG>. These local cursor motions should not alter the text they pass |
| 1197 | over, for example, you would not normally use "<STRONG>cuf1</STRONG>= " because the |
| 1198 | space would erase the character moved over. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1199 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1200 | A very important point here is that the local cursor motions encoded in |
| 1201 | <EM>terminfo</EM> are undefined at the left and top edges of a CRT terminal. |
| 1202 | Programs should never attempt to backspace around the left edge, unless |
| 1203 | <STRONG>bw</STRONG> is given, and never attempt to go up locally off the top. In order |
| 1204 | to scroll text up, a program will go to the bottom left corner of the |
| 1205 | screen and send the <STRONG>ind</STRONG> (index) string. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1206 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1207 | To scroll text down, a program goes to the top left corner of the |
| 1208 | screen and sends the <STRONG>ri</STRONG> (reverse index) string. The strings <STRONG>ind</STRONG> and <STRONG>ri</STRONG> |
| 1209 | are undefined when not on their respective corners of the screen. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1210 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1211 | Parameterized versions of the scrolling sequences are <STRONG>indn</STRONG> and <STRONG>rin</STRONG> |
| 1212 | which have the same semantics as <STRONG>ind</STRONG> and <STRONG>ri</STRONG> except that they take one |
| 1213 | parameter, and scroll that many lines. They are also undefined except |
| 1214 | at the appropriate edge of the screen. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1215 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1216 | The <STRONG>am</STRONG> capability tells whether the cursor sticks at the right edge of |
| 1217 | the screen when text is output, but this does not necessarily apply to |
| 1218 | a <STRONG>cuf1</STRONG> from the last column. The only local motion which is defined |
| 1219 | from the left edge is if <STRONG>bw</STRONG> is given, then a <STRONG>cub1</STRONG> from the left edge |
| 1220 | will move to the right edge of the previous row. If <STRONG>bw</STRONG> is not given, |
| 1221 | the effect is undefined. This is useful for drawing a box around the |
| 1222 | edge of the screen, for example. If the terminal has switch selectable |
| 1223 | automatic margins, the <EM>terminfo</EM> file usually assumes that this is on; |
| 1224 | i.e., <STRONG>am</STRONG>. If the terminal has a command which moves to the first |
| 1225 | column of the next line, that command can be given as <STRONG>nel</STRONG> (newline). |
| 1226 | It does not matter if the command clears the remainder of the current |
| 1227 | line, so if the terminal has no <STRONG>cr</STRONG> and <STRONG>lf</STRONG> it may still be possible to |
| 1228 | craft a working <STRONG>nel</STRONG> out of one or both of them. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1229 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1230 | These capabilities suffice to describe hard-copy and "glass-tty" |
| 1231 | terminals. Thus the model 33 teletype is described as |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1232 | |
| 1233 | 33|tty33|tty|model 33 teletype, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1234 | bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1235 | |
| 1236 | while the Lear Siegler ADM-3 is described as |
| 1237 | |
| 1238 | adm3|3|lsi adm3, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1239 | am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J, |
| 1240 | ind=^J, lines#24, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1241 | |
| 1242 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1243 | </PRE><H3><a name="h3-Parameterized-Strings">Parameterized Strings</a></H3><PRE> |
| 1244 | Cursor addressing and other strings requiring parameters in the |
| 1245 | terminal are described by a parameterized string capability, with |
| 1246 | <EM>printf</EM>-like escapes such as <EM>%x</EM> in it. For example, to address the |
| 1247 | cursor, the <STRONG>cup</STRONG> capability is given, using two parameters: the row and |
| 1248 | column to address to. (Rows and columns are numbered from zero and |
| 1249 | refer to the physical screen visible to the user, not to any unseen |
| 1250 | memory.) If the terminal has memory relative cursor addressing, that |
| 1251 | can be indicated by <STRONG>mrcup</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1252 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1253 | The parameter mechanism uses a stack and special <STRONG>%</STRONG> codes to manipulate |
| 1254 | it. Typically a sequence will push one of the parameters onto the |
| 1255 | stack and then print it in some format. Print (e.g., "%d") is a |
| 1256 | special case. Other operations, including "%t" pop their operand from |
| 1257 | the stack. It is noted that more complex operations are often |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1258 | necessary, e.g., in the <STRONG>sgr</STRONG> string. |
| 1259 | |
| 1260 | The <STRONG>%</STRONG> encodings have the following meanings: |
| 1261 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1262 | <STRONG>%%</STRONG> outputs "%" |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1263 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1264 | <STRONG>%</STRONG><EM>[[</EM>:<EM>]flags][width[.precision]][</EM><STRONG>doxXs</STRONG><EM>]</EM> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1265 | as in <STRONG>printf(3)</STRONG>, flags are <EM>[-+#]</EM> and <EM>space</EM>. Use a ":" to allow |
| 1266 | the next character to be a "-" flag, avoiding interpreting "%-" as |
| 1267 | an operator. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1268 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1269 | <STRONG>%c</STRONG> print <EM>pop()</EM> like %c in <STRONG>printf</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1270 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1271 | <STRONG>%s</STRONG> print <EM>pop()</EM> like %s in <STRONG>printf</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1272 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1273 | <STRONG>%p</STRONG><EM>[1-9]</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1274 | push <EM>i</EM>'th parameter |
| 1275 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1276 | <STRONG>%P</STRONG><EM>[a-z]</EM> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1277 | set dynamic variable <EM>[a-z]</EM> to <EM>pop()</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1278 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1279 | <STRONG>%g</STRONG><EM>[a-z]</EM> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1280 | get dynamic variable <EM>[a-z]</EM> and push it |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1281 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1282 | <STRONG>%P</STRONG><EM>[A-Z]</EM> |
| 1283 | set static variable <EM>[a-z]</EM> to <EM>pop()</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1284 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1285 | <STRONG>%g</STRONG><EM>[A-Z]</EM> |
| 1286 | get static variable <EM>[a-z]</EM> and push it |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1287 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1288 | The terms "static" and "dynamic" are misleading. Historically, |
| 1289 | these are simply two different sets of variables, whose values are |
| 1290 | not reset between calls to <STRONG><A HREF="curs_terminfo.3x.html">tparm(3x)</A></STRONG>. However, that fact is not |
| 1291 | documented in other implementations. Relying on it will adversely |
| 1292 | impact portability to other implementations: |
| 1293 | |
| 1294 | <STRONG>o</STRONG> SVr2 curses supported <EM>dynamic</EM> variables. Those are set only |
| 1295 | by a <STRONG>%P</STRONG> operator. A <STRONG>%g</STRONG> for a given variable without first |
| 1296 | setting it with <STRONG>%P</STRONG> will give unpredictable results, because |
| 1297 | dynamic variables are an uninitialized local array on the |
| 1298 | stack in the <STRONG>tparm</STRONG> function. |
| 1299 | |
| 1300 | <STRONG>o</STRONG> SVr3.2 curses supported <EM>static</EM> variables. Those are an array |
| 1301 | in the <EM>TERMINAL</EM> structure (declared in <STRONG>term.h</STRONG>), and are zeroed |
| 1302 | automatically when the <STRONG>setupterm</STRONG> function allocates the data. |
| 1303 | |
| 1304 | <STRONG>o</STRONG> SVr4 curses made no further improvements to the <EM>dynamic/static</EM> |
| 1305 | variable feature. |
| 1306 | |
| 1307 | <STRONG>o</STRONG> Solaris XPG4 curses does not distinguish between <EM>dynamic</EM> and |
| 1308 | <EM>static</EM> variables. They are the same. Like SVr4 curses, XPG4 |
| 1309 | curses does not initialize these explicitly. |
| 1310 | |
| 1311 | <STRONG>o</STRONG> Before version 6.3, <EM>ncurses</EM> stores both <EM>dynamic</EM> and <EM>static</EM> |
| 1312 | variables in persistent storage, initialized to zeros. |
| 1313 | |
| 1314 | <STRONG>o</STRONG> Beginning with version 6.3, <EM>ncurses</EM> stores <EM>static</EM> and <EM>dynamic</EM> |
| 1315 | variables in the same manner as SVr4. |
| 1316 | |
| 1317 | <STRONG>o</STRONG> Unlike other implementations, <EM>ncurses</EM> zeros dynamic |
| 1318 | variables before the first <STRONG>%g</STRONG> or <STRONG>%P</STRONG> operator. |
| 1319 | |
| 1320 | <STRONG>o</STRONG> Like SVr2, the scope of dynamic variables in <EM>ncurses</EM> is |
| 1321 | within the current call to <STRONG>tparm</STRONG>. Use static variables if |
| 1322 | persistent storage is needed. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1323 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1324 | <STRONG>%'</STRONG><EM>c</EM><STRONG>'</STRONG> char constant <EM>c</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1325 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1326 | <STRONG>%{</STRONG><EM>nn</EM><STRONG>}</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1327 | integer constant <EM>nn</EM> |
| 1328 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1329 | <STRONG>%l</STRONG> push strlen(pop) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1330 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1331 | <STRONG>%+</STRONG>, <STRONG>%-</STRONG>, <STRONG>%*</STRONG>, <STRONG>%/</STRONG>, <STRONG>%m</STRONG> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1332 | arithmetic (%m is <EM>mod</EM>): <EM>push(pop()</EM> <EM>op</EM> <EM>pop())</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1333 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1334 | <STRONG>%&</STRONG>, <STRONG>%|</STRONG>, <STRONG>%^</STRONG> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1335 | bit operations (AND, OR and exclusive-OR): <EM>push(pop()</EM> <EM>op</EM> <EM>pop())</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1336 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1337 | <STRONG>%=</STRONG>, <STRONG>%></STRONG>, <STRONG>%<</STRONG> |
| 1338 | logical operations: <EM>push(pop()</EM> <EM>op</EM> <EM>pop())</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1339 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1340 | <STRONG>%A</STRONG>, <STRONG>%O</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1341 | logical AND and OR operations (for conditionals) |
| 1342 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1343 | <STRONG>%!</STRONG>, <STRONG>%~</STRONG> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1344 | unary operations (logical and bit complement): <EM>push(op</EM> <EM>pop())</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1345 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1346 | <STRONG>%i</STRONG> add 1 to first two parameters (for ANSI terminals) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1347 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1348 | <STRONG>%?</STRONG> <EM>expr</EM> <STRONG>%t</STRONG> <EM>thenpart</EM> <STRONG>%e</STRONG> <EM>elsepart</EM> <STRONG>%;</STRONG> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1349 | This forms an if-then-else. The <STRONG>%e</STRONG> <EM>elsepart</EM> is optional. Usually |
| 1350 | the <STRONG>%?</STRONG> <EM>expr</EM> part pushes a value onto the stack, and <STRONG>%t</STRONG> pops it |
| 1351 | from the stack, testing if it is nonzero (true). If it is zero |
| 1352 | (false), control passes to the <STRONG>%e</STRONG> (else) part. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1353 | |
| 1354 | It is possible to form else-if's a la Algol 68: |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1355 | <STRONG>%?</STRONG> c1 <STRONG>%t</STRONG> b1 <STRONG>%e</STRONG> c2 <STRONG>%t</STRONG> b2 <STRONG>%e</STRONG> c3 <STRONG>%t</STRONG> b3 <STRONG>%e</STRONG> c4 <STRONG>%t</STRONG> b4 <STRONG>%e</STRONG> <STRONG>%;</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1356 | |
| 1357 | where ci are conditions, bi are bodies. |
| 1358 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1359 | Use the <STRONG>-f</STRONG> option of <STRONG>tic</STRONG> or <STRONG>infocmp</STRONG> to see the structure of if- |
| 1360 | then-else's. Some strings, e.g., <STRONG>sgr</STRONG> can be very complicated when |
| 1361 | written on one line. The <STRONG>-f</STRONG> option splits the string into lines |
| 1362 | with the parts indented. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1363 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1364 | Binary operations are in postfix form with the operands in the usual |
| 1365 | order. That is, to get x-5 one would use "%gx%{5}%-". <STRONG>%P</STRONG> and <STRONG>%g</STRONG> |
| 1366 | variables are persistent across escape-string evaluations. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1367 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1368 | Consider the HP2645, which, to get to row 3 and column 12, needs to be |
| 1369 | sent \E&a12c03Y padded for 6 milliseconds. The order of the rows and |
| 1370 | columns is inverted here, and the row and column are printed as two |
| 1371 | digits. The corresponding terminal description is expressed thus: |
| 1372 | cup=\E&a%p2%dc%p1%dY$<6>, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1373 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1374 | The Microterm ACT-IV needs the current row and column sent preceded by |
| 1375 | a <STRONG>^T</STRONG>, with the row and column simply encoded in binary, |
| 1376 | cup=^T%p1%c%p2%c |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1377 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1378 | Terminals which use "%c" need to be able to backspace the cursor |
| 1379 | (<STRONG>cub1</STRONG>), and to move the cursor up one line on the screen (<STRONG>cuu1</STRONG>). This |
| 1380 | is necessary because it is not always safe to transmit <STRONG>\n</STRONG> <STRONG>^D</STRONG> and <STRONG>\r</STRONG>, as |
| 1381 | the system may change or discard them. (The library routines dealing |
| 1382 | with terminfo set tty modes so that tabs are never expanded, so \t is |
| 1383 | safe to send. This turns out to be essential for the Ann Arbor 4080.) |
| 1384 | |
| 1385 | A final example is the LSI ADM-3a, which uses row and column offset by |
| 1386 | a blank character, thus |
| 1387 | cup=\E=%p1%' '%+%c%p2%' '%+%c |
| 1388 | |
| 1389 | After sending "\E=", this pushes the first parameter, pushes the ASCII |
| 1390 | value for a space (32), adds them (pushing the sum on the stack in |
| 1391 | place of the two previous values) and outputs that value as a |
| 1392 | character. Then the same is done for the second parameter. More |
| 1393 | complex arithmetic is possible using the stack. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1394 | |
| 1395 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1396 | </PRE><H3><a name="h3-Cursor-Motions">Cursor Motions</a></H3><PRE> |
| 1397 | If the terminal has a fast way to home the cursor (to very upper left |
| 1398 | corner of screen) then this can be given as <STRONG>home</STRONG>; similarly a fast way |
| 1399 | of getting to the lower left-hand corner can be given as <STRONG>ll</STRONG>; this may |
| 1400 | involve going up with <STRONG>cuu1</STRONG> from the home position, but a program should |
| 1401 | never do this itself (unless <STRONG>ll</STRONG> does) because it can make no assumption |
| 1402 | about the effect of moving up from the home position. Note that the |
| 1403 | home position is the same as addressing to (0,0): to the top left |
| 1404 | corner of the screen, not of memory. (Thus, the \EH sequence on HP |
| 1405 | terminals cannot be used for <STRONG>home</STRONG>.) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1406 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1407 | If the terminal has row or column absolute cursor addressing, these can |
| 1408 | be given as single parameter capabilities <STRONG>hpa</STRONG> (horizontal position |
| 1409 | absolute) and <STRONG>vpa</STRONG> (vertical position absolute). Sometimes these are |
| 1410 | shorter than the more general two parameter sequence (as with the |
| 1411 | hp2645) and can be used in preference to <STRONG>cup</STRONG>. If there are |
| 1412 | parameterized local motions (e.g., move <EM>n</EM> spaces to the right) these |
| 1413 | can be given as <STRONG>cud</STRONG>, <STRONG>cub</STRONG>, <STRONG>cuf</STRONG>, and <STRONG>cuu</STRONG> with a single parameter |
| 1414 | indicating how many spaces to move. These are primarily useful if the |
| 1415 | terminal does not have <STRONG>cup</STRONG>, such as the TEKTRONIX 4025. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1416 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1417 | If the terminal needs to be in a special mode when running a program |
| 1418 | that uses these capabilities, the codes to enter and exit this mode can |
| 1419 | be given as <STRONG>smcup</STRONG> and <STRONG>rmcup</STRONG>. This arises, for example, from terminals |
| 1420 | like the Concept with more than one page of memory. If the terminal |
| 1421 | has only memory relative cursor addressing and not screen relative |
| 1422 | cursor addressing, a one screen-sized window must be fixed into the |
| 1423 | terminal for cursor addressing to work properly. This is also used for |
| 1424 | the TEKTRONIX 4025, where <STRONG>smcup</STRONG> sets the command character to be the |
| 1425 | one used by terminfo. If the <STRONG>smcup</STRONG> sequence will not restore the |
| 1426 | screen after an <STRONG>rmcup</STRONG> sequence is output (to the state prior to |
| 1427 | outputting <STRONG>rmcup</STRONG>), specify <STRONG>nrrmc</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1428 | |
| 1429 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1430 | </PRE><H3><a name="h3-Margins">Margins</a></H3><PRE> |
| 1431 | SVr4 (and X/Open Curses) list several string capabilities for setting |
| 1432 | margins. Two were intended for use with terminals, and another six |
| 1433 | were intended for use with printers. |
| 1434 | |
| 1435 | <STRONG>o</STRONG> The two terminal capabilities assume that the terminal may have the |
| 1436 | capability of setting the left and/or right margin at the current |
| 1437 | cursor column position. |
| 1438 | |
| 1439 | <STRONG>o</STRONG> The printer capabilities assume that the printer may have two types |
| 1440 | of capability: |
| 1441 | |
| 1442 | <STRONG>o</STRONG> the ability to set a top and/or bottom margin using the current |
| 1443 | line position, and |
| 1444 | |
| 1445 | <STRONG>o</STRONG> parameterized capabilities for setting the top, bottom, left, |
| 1446 | right margins given the number of rows or columns. |
| 1447 | |
| 1448 | In practice, the categorization into "terminal" and "printer" is not |
| 1449 | suitable: |
| 1450 | |
| 1451 | <STRONG>o</STRONG> The AT&T SVr4 terminal database uses <STRONG>smgl</STRONG> four times, for AT&T |
| 1452 | hardware. |
| 1453 | |
| 1454 | Three of the four are printers. They lack the ability to set |
| 1455 | left/right margins by specifying the column. |
| 1456 | |
| 1457 | <STRONG>o</STRONG> Other (non-AT&T) terminals may support margins but using different |
| 1458 | assumptions from AT&T. |
| 1459 | |
| 1460 | For instance, the DEC VT420 supports left/right margins, but only |
| 1461 | using a column parameter. As an added complication, the VT420 uses |
| 1462 | two settings to fully enable left/right margins (left/right margin |
| 1463 | mode, and origin mode). The former enables the margins, which |
| 1464 | causes printed text to wrap within margins, but the latter is |
| 1465 | needed to prevent cursor-addressing outside those margins. |
| 1466 | |
| 1467 | <STRONG>o</STRONG> Both DEC VT420 left/right margins are set with a single control |
| 1468 | sequence. If either is omitted, the corresponding margin is set to |
| 1469 | the left or right edge of the display (rather than leaving the |
| 1470 | margin unmodified). |
| 1471 | |
| 1472 | These are the margin-related capabilities: |
| 1473 | |
| 1474 | <STRONG>Name</STRONG> <STRONG>Description</STRONG> |
| 1475 | --------------------------------------------------- |
| 1476 | <STRONG>smgl</STRONG> Set left margin at current column |
| 1477 | <STRONG>smgr</STRONG> Set right margin at current column |
| 1478 | <STRONG>smgb</STRONG> Set bottom margin at current line |
| 1479 | <STRONG>smgt</STRONG> Set top margin at current line |
| 1480 | <STRONG>smgbp</STRONG> Set bottom margin at line <EM>N</EM> |
| 1481 | <STRONG>smglp</STRONG> Set left margin at column <EM>N</EM> |
| 1482 | <STRONG>smgrp</STRONG> Set right margin at column <EM>N</EM> |
| 1483 | <STRONG>smgtp</STRONG> Set top margin at line <EM>N</EM> |
| 1484 | <STRONG>smglr</STRONG> Set both left and right margins to <EM>L</EM> and <EM>R</EM> |
| 1485 | <STRONG>smgtb</STRONG> Set both top and bottom margins to <EM>T</EM> and <EM>B</EM> |
| 1486 | |
| 1487 | When writing an application that uses these string capabilities, the |
| 1488 | pairs should be first checked to see if each capability in the pair is |
| 1489 | set or only one is set: |
| 1490 | |
| 1491 | <STRONG>o</STRONG> If both <STRONG>smglp</STRONG> and <STRONG>smgrp</STRONG> are set, each is used with a single |
| 1492 | argument, <EM>N</EM>, that gives the column number of the left and right |
| 1493 | margin, respectively. |
| 1494 | |
| 1495 | <STRONG>o</STRONG> If both <STRONG>smgtp</STRONG> and <STRONG>smgbp</STRONG> are set, each is used to set the top and |
| 1496 | bottom margin, respectively: |
| 1497 | |
| 1498 | <STRONG>o</STRONG> <STRONG>smgtp</STRONG> is used with a single argument, <EM>N</EM>, the line number of the |
| 1499 | top margin. |
| 1500 | |
| 1501 | <STRONG>o</STRONG> <STRONG>smgbp</STRONG> is used with two arguments, <EM>N</EM> and <EM>M</EM>, that give the line |
| 1502 | number of the bottom margin, the first counting from the top of |
| 1503 | the page and the second counting from the bottom. This |
| 1504 | accommodates the two styles of specifying the bottom margin in |
| 1505 | different manufacturers' printers. |
| 1506 | |
| 1507 | When designing a terminfo entry for a printer that has a settable |
| 1508 | bottom margin, only the first or second argument should be used, |
| 1509 | depending on the printer. When developing an application that uses |
| 1510 | <STRONG>smgbp</STRONG> to set the bottom margin, both arguments must be given. |
| 1511 | |
| 1512 | Conversely, when only one capability in the pair is set: |
| 1513 | |
| 1514 | <STRONG>o</STRONG> If only one of <STRONG>smglp</STRONG> and <STRONG>smgrp</STRONG> is set, then it is used with two |
| 1515 | arguments, the column number of the left and right margins, in that |
| 1516 | order. |
| 1517 | |
| 1518 | <STRONG>o</STRONG> Likewise, if only one of <STRONG>smgtp</STRONG> and <STRONG>smgbp</STRONG> is set, then it is used |
| 1519 | with two arguments that give the top and bottom margins, in that |
| 1520 | order, counting from the top of the page. |
| 1521 | |
| 1522 | When designing a terminfo entry for a printer that requires setting |
| 1523 | both left and right or top and bottom margins simultaneously, only |
| 1524 | one capability in the pairs <STRONG>smglp</STRONG> and <STRONG>smgrp</STRONG> or <STRONG>smgtp</STRONG> and <STRONG>smgbp</STRONG> |
| 1525 | should be defined, leaving the other unset. |
| 1526 | |
| 1527 | Except for very old terminal descriptions, e.g., those developed for |
| 1528 | SVr4, the scheme just described should be considered obsolete. An |
| 1529 | improved set of capabilities was added late in the SVr4 releases (<STRONG>smglr</STRONG> |
| 1530 | and <STRONG>smgtb</STRONG>), which explicitly use two parameters for setting the |
| 1531 | left/right or top/bottom margins. |
| 1532 | |
| 1533 | When setting margins, the line- and column-values are zero-based. |
| 1534 | |
| 1535 | The <STRONG>mgc</STRONG> string capability should be defined. Applications such as |
| 1536 | <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG> rely upon this to reset all margins. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1537 | |
| 1538 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1539 | </PRE><H3><a name="h3-Area-Clears">Area Clears</a></H3><PRE> |
| 1540 | If the terminal can clear from the current position to the end of the |
| 1541 | line, leaving the cursor where it is, this should be given as <STRONG>el</STRONG>. If |
| 1542 | the terminal can clear from the beginning of the line to the current |
| 1543 | position inclusive, leaving the cursor where it is, this should be |
| 1544 | given as <STRONG>el1</STRONG>. If the terminal can clear from the current position to |
| 1545 | the end of the display, then this should be given as <STRONG>ed</STRONG>. <STRONG>Ed</STRONG> is only |
| 1546 | defined from the first column of a line. (Thus, it can be simulated by |
| 1547 | a request to delete a large number of lines, if a true <STRONG>ed</STRONG> is not |
| 1548 | available.) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1549 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1550 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1551 | </PRE><H3><a name="h3-Insert_Delete-Line-and-Vertical-Motions">Insert/Delete Line and Vertical Motions</a></H3><PRE> |
| 1552 | If the terminal can open a new blank line before the line where the |
| 1553 | cursor is, this should be given as <STRONG>il1</STRONG>; this is done only from the |
| 1554 | first position of a line. The cursor must then appear on the newly |
| 1555 | blank line. If the terminal can delete the line which the cursor is |
| 1556 | on, then this should be given as <STRONG>dl1</STRONG>; this is done only from the first |
| 1557 | position on the line to be deleted. Versions of <STRONG>il1</STRONG> and <STRONG>dl1</STRONG> which take |
| 1558 | a single parameter and insert or delete that many lines can be given as |
| 1559 | <STRONG>il</STRONG> and <STRONG>dl</STRONG>. |
| 1560 | |
| 1561 | If the terminal has a settable scrolling region (like the vt100) the |
| 1562 | command to set this can be described with the <STRONG>csr</STRONG> capability, which |
| 1563 | takes two parameters: the top and bottom lines of the scrolling region. |
| 1564 | The cursor position is, alas, undefined after using this command. |
| 1565 | |
| 1566 | It is possible to get the effect of insert or delete line using <STRONG>csr</STRONG> on |
| 1567 | a properly chosen region; the <STRONG>sc</STRONG> and <STRONG>rc</STRONG> (save and restore cursor) |
| 1568 | commands may be useful for ensuring that your synthesized insert/delete |
| 1569 | string does not move the cursor. (Note that the <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> library |
| 1570 | does this synthesis automatically, so you need not compose |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1571 | insert/delete strings for an entry with <STRONG>csr</STRONG>). |
| 1572 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1573 | Yet another way to construct insert and delete might be to use a |
| 1574 | combination of index with the memory-lock feature found on some |
| 1575 | terminals (like the HP-700/90 series, which however also has |
| 1576 | insert/delete). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1577 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1578 | Inserting lines at the top or bottom of the screen can also be done |
| 1579 | using <STRONG>ri</STRONG> or <STRONG>ind</STRONG> on many terminals without a true insert/delete line, |
| 1580 | and is often faster even on terminals with those features. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1581 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1582 | The Boolean <STRONG>non_dest_scroll_region</STRONG> should be set if each scrolling |
| 1583 | window is effectively a view port on a screen-sized canvas. To test |
| 1584 | for this capability, create a scrolling region in the middle of the |
| 1585 | screen, write something to the bottom line, move the cursor to the top |
| 1586 | of the region, and do <STRONG>ri</STRONG> followed by <STRONG>dl1</STRONG> or <STRONG>ind</STRONG>. If the data scrolled |
| 1587 | off the bottom of the region by the <STRONG>ri</STRONG> re-appears, then scrolling is |
| 1588 | non-destructive. System V and X/Open Curses expect that <STRONG>ind</STRONG>, <STRONG>ri</STRONG>, <STRONG>indn</STRONG>, |
| 1589 | and <STRONG>rin</STRONG> will simulate destructive scrolling; their documentation |
| 1590 | cautions you not to define <STRONG>csr</STRONG> unless this is true. This <STRONG>curses</STRONG> |
| 1591 | implementation is more liberal and will do explicit erases after |
| 1592 | scrolling if <STRONG>ndsrc</STRONG> is defined. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1593 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1594 | If the terminal has the ability to define a window as part of memory, |
| 1595 | which all commands affect, it should be given as the parameterized |
| 1596 | string <STRONG>wind</STRONG>. The four parameters are the starting and ending lines in |
| 1597 | memory and the starting and ending columns in memory, in that order. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1598 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1599 | If the terminal can retain display memory above, then the <STRONG>da</STRONG> capability |
| 1600 | should be given; if display memory can be retained below, then <STRONG>db</STRONG> |
| 1601 | should be given. These indicate that deleting a line or scrolling may |
| 1602 | bring non-blank lines up from below or that scrolling back with <STRONG>ri</STRONG> may |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1603 | bring down non-blank lines. |
| 1604 | |
| 1605 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1606 | </PRE><H3><a name="h3-Insert_Delete-Character">Insert/Delete Character</a></H3><PRE> |
| 1607 | There are two basic kinds of intelligent terminals with respect to |
| 1608 | insert/delete character which can be described using <EM>terminfo</EM>. The |
| 1609 | most common insert/delete character operations affect only the |
| 1610 | characters on the current line and shift characters off the end of the |
| 1611 | line rigidly. Other terminals, such as the Concept 100 and the Perkin |
| 1612 | Elmer Owl, make a distinction between typed and untyped blanks on the |
| 1613 | screen, shifting upon an insert or delete only to an untyped blank on |
| 1614 | the screen which is either eliminated, or expanded to two untyped |
| 1615 | blanks. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1616 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1617 | You can determine the kind of terminal you have by clearing the screen |
| 1618 | and then typing text separated by cursor motions. Type "abc def" |
| 1619 | using local cursor motions (not spaces) between the "abc" and the |
| 1620 | "def". Then position the cursor before the "abc" and put the terminal |
| 1621 | in insert mode. If typing characters causes the rest of the line to |
| 1622 | shift rigidly and characters to fall off the end, then your terminal |
| 1623 | does not distinguish between blanks and untyped positions. If the |
| 1624 | "abc" shifts over to the "def" which then move together around the end |
| 1625 | of the current line and onto the next as you insert, you have the |
| 1626 | second type of terminal, and should give the capability <STRONG>in</STRONG>, which |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1627 | stands for "insert null". |
| 1628 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1629 | While these are two logically separate attributes (one line versus |
| 1630 | multi-line insert mode, and special treatment of untyped spaces) we |
| 1631 | have seen no terminals whose insert mode cannot be described with the |
| 1632 | single attribute. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1633 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1634 | Terminfo can describe both terminals which have an insert mode, and |
| 1635 | terminals which send a simple sequence to open a blank position on the |
| 1636 | current line. Give as <STRONG>smir</STRONG> the sequence to get into insert mode. Give |
| 1637 | as <STRONG>rmir</STRONG> the sequence to leave insert mode. Now give as <STRONG>ich1</STRONG> any |
| 1638 | sequence needed to be sent just before sending the character to be |
| 1639 | inserted. Most terminals with a true insert mode will not give <STRONG>ich1</STRONG>; |
| 1640 | terminals which send a sequence to open a screen position should give |
| 1641 | it here. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1642 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1643 | If your terminal has both, insert mode is usually preferable to <STRONG>ich1</STRONG>. |
| 1644 | Technically, you should not give both unless the terminal actually |
| 1645 | requires both to be used in combination. Accordingly, some non-curses |
| 1646 | applications get confused if both are present; the symptom is doubled |
| 1647 | characters in an update using insert. This requirement is now rare; |
| 1648 | most <STRONG>ich</STRONG> sequences do not require previous smir, and most smir insert |
| 1649 | modes do not require <STRONG>ich1</STRONG> before each character. Therefore, the new |
| 1650 | <STRONG>curses</STRONG> actually assumes this is the case and uses either <STRONG>rmir</STRONG>/<STRONG>smir</STRONG> or |
| 1651 | <STRONG>ich</STRONG>/<STRONG>ich1</STRONG> as appropriate (but not both). If you have to write an entry |
| 1652 | to be used under new curses for a terminal old enough to need both, |
| 1653 | include the <STRONG>rmir</STRONG>/<STRONG>smir</STRONG> sequences in <STRONG>ich1</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1654 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1655 | If post insert padding is needed, give this as a number of milliseconds |
| 1656 | in <STRONG>ip</STRONG> (a string option). Any other sequence which may need to be sent |
| 1657 | after an insert of a single character may also be given in <STRONG>ip</STRONG>. If your |
| 1658 | terminal needs both to be placed into an "insert mode" and a special |
| 1659 | code to precede each inserted character, then both <STRONG>smir</STRONG>/<STRONG>rmir</STRONG> and <STRONG>ich1</STRONG> |
| 1660 | can be given, and both will be used. The <STRONG>ich</STRONG> capability, with one |
| 1661 | parameter, <EM>n</EM>, will repeat the effects of <STRONG>ich1</STRONG> <EM>n</EM> times. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1662 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1663 | If padding is necessary between characters typed while not in insert |
| 1664 | mode, give this as a number of milliseconds padding in <STRONG>rmp</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1665 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1666 | It is occasionally necessary to move around while in insert mode to |
| 1667 | delete characters on the same line (e.g., if there is a tab after the |
| 1668 | insertion position). If your terminal allows motion while in insert |
| 1669 | mode you can give the capability <STRONG>mir</STRONG> to speed up inserting in this |
| 1670 | case. Omitting <STRONG>mir</STRONG> will affect only speed. Some terminals (notably |
| 1671 | Datamedia's) must not have <STRONG>mir</STRONG> because of the way their insert mode |
| 1672 | works. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1673 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1674 | Finally, you can specify <STRONG>dch1</STRONG> to delete a single character, <STRONG>dch</STRONG> with |
| 1675 | one parameter, <EM>n</EM>, to delete <EM>n</EM>characters, and delete mode by giving <STRONG>smdc</STRONG> |
| 1676 | and <STRONG>rmdc</STRONG> to enter and exit delete mode (any mode the terminal needs to |
| 1677 | be placed in for <STRONG>dch1</STRONG> to work). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1678 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1679 | A command to erase <EM>n</EM> characters (equivalent to outputting <EM>n</EM> blanks |
| 1680 | without moving the cursor) can be given as <STRONG>ech</STRONG> with one parameter. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1681 | |
| 1682 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1683 | </PRE><H3><a name="h3-Highlighting_Underlining_and-Visible-Bells">Highlighting, Underlining, and Visible Bells</a></H3><PRE> |
| 1684 | If your terminal has one or more kinds of display attributes, these can |
| 1685 | be represented in a number of different ways. You should choose one |
| 1686 | display form as <EM>standout</EM> <EM>mode</EM>, representing a good, high contrast, |
| 1687 | easy-on-the-eyes, format for highlighting error messages and other |
| 1688 | attention getters. (If you have a choice, reverse video plus half- |
| 1689 | bright is good, or reverse video alone.) The sequences to enter and |
| 1690 | exit standout mode are given as <STRONG>smso</STRONG> and <STRONG>rmso</STRONG>, respectively. If the |
| 1691 | code to change into or out of standout mode leaves one or even two |
| 1692 | blank spaces on the screen, as the TVI 912 and Teleray 1061 do, then |
| 1693 | <STRONG>xmc</STRONG> should be given to tell how many spaces are left. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1694 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1695 | Codes to begin underlining and end underlining can be given as <STRONG>smul</STRONG> and |
| 1696 | <STRONG>rmul</STRONG> respectively. If the terminal has a code to underline the current |
| 1697 | character and move the cursor one space to the right, such as the |
| 1698 | Microterm Mime, this can be given as <STRONG>uc</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1699 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1700 | Other capabilities to enter various highlighting modes include <STRONG>blink</STRONG> |
| 1701 | (blinking) <STRONG>bold</STRONG> (bold or extra bright) <STRONG>dim</STRONG> (dim or half-bright) <STRONG>invis</STRONG> |
| 1702 | (blanking or invisible text) <STRONG>prot</STRONG> (protected) <STRONG>rev</STRONG> (reverse video) <STRONG>sgr0</STRONG> |
| 1703 | (turn off <EM>all</EM> attribute modes) <STRONG>smacs</STRONG> (enter alternate character set |
| 1704 | mode) and <STRONG>rmacs</STRONG> (exit alternate character set mode). Turning on any of |
| 1705 | these modes singly may or may not turn off other modes. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1706 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1707 | If there is a sequence to set arbitrary combinations of modes, this |
| 1708 | should be given as <STRONG>sgr</STRONG> (set attributes), taking 9 parameters. Each |
| 1709 | parameter is either zero (0) or nonzero, as the corresponding attribute |
| 1710 | is on or off. The 9 parameters are, in order: standout, underline, |
| 1711 | reverse, blink, dim, bold, blank, protect, alternate character set. |
| 1712 | Not all modes need be supported by <STRONG>sgr</STRONG>, only those for which |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1713 | corresponding separate attribute commands exist. |
| 1714 | |
| 1715 | For example, the DEC vt220 supports most of the modes: |
| 1716 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1717 | <STRONG>tparm</STRONG> <STRONG>Parameter</STRONG> <STRONG>Attribute</STRONG> <STRONG>Escape</STRONG> <STRONG>Sequence</STRONG> |
| 1718 | ------------------------------------------------ |
| 1719 | none none \E[0m |
| 1720 | p1 standout \E[0;1;7m |
| 1721 | p2 underline \E[0;4m |
| 1722 | p3 reverse \E[0;7m |
| 1723 | p4 blink \E[0;5m |
| 1724 | p5 dim not available |
| 1725 | p6 bold \E[0;1m |
| 1726 | p7 invis \E[0;8m |
| 1727 | p8 protect not used |
| 1728 | p9 altcharset ^O (off) ^N (on) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1729 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1730 | We begin each escape sequence by turning off any existing modes, since |
| 1731 | there is no quick way to determine whether they are active. Standout |
| 1732 | is set up to be the combination of reverse and bold. The vt220 |
| 1733 | terminal has a protect mode, though it is not commonly used in sgr |
| 1734 | because it protects characters on the screen from the host's erasures. |
| 1735 | The altcharset mode also is different in that it is either ^O or ^N, |
| 1736 | depending on whether it is off or on. If all modes are turned on, the |
| 1737 | resulting sequence is \E[0;1;4;5;7;8m^N. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1738 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1739 | Some sequences are common to different modes. For example, ;7 is |
| 1740 | output when either p1 or p3 is true, that is, if either standout or |
| 1741 | reverse modes are turned on. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1742 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1743 | Writing out the above sequences, along with their dependencies yields |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1744 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1745 | <STRONG>Sequence</STRONG> <STRONG>When</STRONG> <STRONG>to</STRONG> <STRONG>Output</STRONG> <STRONG>terminfo</STRONG> <STRONG>Translation</STRONG> |
| 1746 | ---------------------------------------------------- |
| 1747 | \E[0 always \E[0 |
| 1748 | ;1 if p1 or p6 %?%p1%p6%|%t;1%; |
| 1749 | ;4 if p2 %?%p2%|%t;4%; |
| 1750 | ;5 if p4 %?%p4%|%t;5%; |
| 1751 | ;7 if p1 or p3 %?%p1%p3%|%t;7%; |
| 1752 | ;8 if p7 %?%p7%|%t;8%; |
| 1753 | m always m |
| 1754 | ^N or ^O if p9 ^N, else ^O %?%p9%t^N%e^O%; |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1755 | |
| 1756 | Putting this all together into the sgr sequence gives: |
| 1757 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1758 | sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p4%t;5%; |
| 1759 | %?%p1%p3%|%t;7%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1760 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1761 | Remember that if you specify sgr, you must also specify sgr0. Also, |
| 1762 | some implementations rely on sgr being given if sgr0 is, Not all |
| 1763 | terminfo entries necessarily have an sgr string, however. Many |
| 1764 | terminfo entries are derived from termcap entries which have no sgr |
| 1765 | string. The only drawback to adding an sgr string is that termcap also |
| 1766 | assumes that sgr0 does not exit alternate character set mode. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1767 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1768 | Terminals with the "magic cookie" glitch (<STRONG>xmc</STRONG>) deposit special |
| 1769 | "cookies" when they receive mode-setting sequences, which affect the |
| 1770 | display algorithm rather than having extra bits for each character. |
| 1771 | Some terminals, such as the HP 2621, automatically leave standout mode |
| 1772 | when they move to a new line or the cursor is addressed. Programs |
| 1773 | using standout mode should exit standout mode before moving the cursor |
| 1774 | or sending a newline, unless the <STRONG>msgr</STRONG> capability, asserting that it is |
| 1775 | safe to move in standout mode, is present. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1776 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1777 | If the terminal has a way of flashing the screen to indicate an error |
| 1778 | quietly (a bell replacement) then this can be given as <STRONG>flash</STRONG>; it must |
| 1779 | not move the cursor. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1780 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1781 | If the cursor needs to be made more visible than normal when it is not |
| 1782 | on the bottom line (to make, for example, a non-blinking underline into |
| 1783 | an easier to find block or blinking underline) give this sequence as |
| 1784 | <STRONG>cvvis</STRONG>. If there is a way to make the cursor completely invisible, give |
| 1785 | that as <STRONG>civis</STRONG>. The capability <STRONG>cnorm</STRONG> should be given which undoes the |
| 1786 | effects of both of these modes. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1787 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1788 | If your terminal correctly generates underlined characters (with no |
| 1789 | special codes needed) even though it does not overstrike, then you |
| 1790 | should give the capability <STRONG>ul</STRONG>. If a character overstriking another |
| 1791 | leaves both characters on the screen, specify the capability <STRONG>os</STRONG>. If |
| 1792 | overstrikes are erasable with a blank, then this should be indicated by |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1793 | giving <STRONG>eo</STRONG>. |
| 1794 | |
| 1795 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1796 | </PRE><H3><a name="h3-Keypad-and-Function-Keys">Keypad and Function Keys</a></H3><PRE> |
| 1797 | If the terminal has a keypad that transmits codes when the keys are |
| 1798 | pressed, this information can be given. Note that it is not possible |
| 1799 | to handle terminals where the keypad only works in local (this applies, |
| 1800 | for example, to the unshifted HP 2621 keys). If the keypad can be set |
| 1801 | to transmit or not transmit, give these codes as <STRONG>smkx</STRONG> and <STRONG>rmkx</STRONG>. |
| 1802 | Otherwise the keypad is assumed to always transmit. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1803 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1804 | The codes sent by the left arrow, right arrow, up arrow, down arrow, |
| 1805 | and home keys can be given as <STRONG>kcub1,</STRONG> <STRONG>kcuf1,</STRONG> <STRONG>kcuu1,</STRONG> <STRONG>kcud1,</STRONG> and <STRONG>khome</STRONG> |
| 1806 | respectively. If there are function keys such as f0, f1, ..., f10, the |
| 1807 | codes they send can be given as <STRONG>kf0,</STRONG> <STRONG>kf1,</STRONG> <STRONG>...,</STRONG> <STRONG>kf10</STRONG>. If these keys |
| 1808 | have labels other than the default f0 through f10, the labels can be |
| 1809 | given as <STRONG>lf0,</STRONG> <STRONG>lf1,</STRONG> <STRONG>...,</STRONG> <STRONG>lf10</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1810 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1811 | The codes transmitted by certain other special keys can be given: |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1812 | |
| 1813 | <STRONG>o</STRONG> <STRONG>kll</STRONG> (home down), |
| 1814 | |
| 1815 | <STRONG>o</STRONG> <STRONG>kbs</STRONG> (backspace), |
| 1816 | |
| 1817 | <STRONG>o</STRONG> <STRONG>ktbc</STRONG> (clear all tabs), |
| 1818 | |
| 1819 | <STRONG>o</STRONG> <STRONG>kctab</STRONG> (clear the tab stop in this column), |
| 1820 | |
| 1821 | <STRONG>o</STRONG> <STRONG>kclr</STRONG> (clear screen or erase key), |
| 1822 | |
| 1823 | <STRONG>o</STRONG> <STRONG>kdch1</STRONG> (delete character), |
| 1824 | |
| 1825 | <STRONG>o</STRONG> <STRONG>kdl1</STRONG> (delete line), |
| 1826 | |
| 1827 | <STRONG>o</STRONG> <STRONG>krmir</STRONG> (exit insert mode), |
| 1828 | |
| 1829 | <STRONG>o</STRONG> <STRONG>kel</STRONG> (clear to end of line), |
| 1830 | |
| 1831 | <STRONG>o</STRONG> <STRONG>ked</STRONG> (clear to end of screen), |
| 1832 | |
| 1833 | <STRONG>o</STRONG> <STRONG>kich1</STRONG> (insert character or enter insert mode), |
| 1834 | |
| 1835 | <STRONG>o</STRONG> <STRONG>kil1</STRONG> (insert line), |
| 1836 | |
| 1837 | <STRONG>o</STRONG> <STRONG>knp</STRONG> (next page), |
| 1838 | |
| 1839 | <STRONG>o</STRONG> <STRONG>kpp</STRONG> (previous page), |
| 1840 | |
| 1841 | <STRONG>o</STRONG> <STRONG>kind</STRONG> (scroll forward/down), |
| 1842 | |
| 1843 | <STRONG>o</STRONG> <STRONG>kri</STRONG> (scroll backward/up), |
| 1844 | |
| 1845 | <STRONG>o</STRONG> <STRONG>khts</STRONG> (set a tab stop in this column). |
| 1846 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1847 | In addition, if the keypad has a 3 by 3 array of keys including the |
| 1848 | four arrow keys, the other five keys can be given as <STRONG>ka1</STRONG>, <STRONG>ka3</STRONG>, <STRONG>kb2</STRONG>, |
| 1849 | <STRONG>kc1</STRONG>, and <STRONG>kc3</STRONG>. These keys are useful when the effects of a 3 by 3 |
| 1850 | directional pad are needed. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1851 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1852 | Strings to program function keys can be given as <STRONG>pfkey</STRONG>, <STRONG>pfloc</STRONG>, and <STRONG>pfx</STRONG>. |
| 1853 | A string to program screen labels should be specified as <STRONG>pln</STRONG>. Each of |
| 1854 | these strings takes two parameters: the function key number to program |
| 1855 | (from 0 to 10) and the string to program it with. Function key numbers |
| 1856 | out of this range may program undefined keys in a terminal dependent |
| 1857 | manner. The difference between the capabilities is that <STRONG>pfkey</STRONG> causes |
| 1858 | pressing the given key to be the same as the user typing the given |
| 1859 | string; <STRONG>pfloc</STRONG> causes the string to be executed by the terminal in |
| 1860 | local; and <STRONG>pfx</STRONG> causes the string to be transmitted to the computer. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1861 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1862 | The capabilities <STRONG>nlab</STRONG>, <STRONG>lw</STRONG> and <STRONG>lh</STRONG> define the number of programmable |
| 1863 | screen labels and their width and height. If there are commands to |
| 1864 | turn the labels on and off, give them in <STRONG>smln</STRONG> and <STRONG>rmln</STRONG>. <STRONG>smln</STRONG> is |
| 1865 | normally output after one or more pln sequences to make sure that the |
| 1866 | change becomes visible. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1867 | |
| 1868 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1869 | </PRE><H3><a name="h3-Tabs-and-Initialization">Tabs and Initialization</a></H3><PRE> |
| 1870 | A few capabilities are used only for tabs: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1871 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1872 | <STRONG>o</STRONG> If the terminal has hardware tabs, the command to advance to the |
| 1873 | next tab stop can be given as <STRONG>ht</STRONG> (usually control/I). |
| 1874 | |
| 1875 | <STRONG>o</STRONG> A "back-tab" command which moves leftward to the preceding tab stop |
| 1876 | can be given as <STRONG>cbt</STRONG>. |
| 1877 | |
| 1878 | By convention, if the teletype modes indicate that tabs are being |
| 1879 | expanded by the computer rather than being sent to the terminal, |
| 1880 | programs should not use <STRONG>ht</STRONG> or <STRONG>cbt</STRONG> even if they are present, since |
| 1881 | the user may not have the tab stops properly set. |
| 1882 | |
| 1883 | <STRONG>o</STRONG> If the terminal has hardware tabs which are initially set every <EM>n</EM> |
| 1884 | spaces when the terminal is powered up, the numeric parameter <STRONG>it</STRONG> is |
| 1885 | given, showing the number of spaces the tabs are set to. |
| 1886 | |
| 1887 | The <STRONG>it</STRONG> capability is normally used by the <STRONG>tset</STRONG> command to determine |
| 1888 | whether to set the mode for hardware tab expansion, and whether to |
| 1889 | set the tab stops. If the terminal has tab stops that can be saved |
| 1890 | in non-volatile memory, the terminfo description can assume that |
| 1891 | they are properly set. |
| 1892 | |
| 1893 | Other capabilities include |
| 1894 | |
| 1895 | <STRONG>o</STRONG> <STRONG>is1</STRONG>, <STRONG>is2</STRONG>, and <STRONG>is3</STRONG>, initialization strings for the terminal, |
| 1896 | |
| 1897 | <STRONG>o</STRONG> <STRONG>iprog</STRONG>, the path name of a program to be run to initialize the |
| 1898 | terminal, |
| 1899 | |
| 1900 | <STRONG>o</STRONG> and <STRONG>if</STRONG>, the name of a file containing long initialization strings. |
| 1901 | |
| 1902 | These strings are expected to set the terminal into modes consistent |
| 1903 | with the rest of the terminfo description. They are normally sent to |
| 1904 | the terminal, by the <EM>init</EM> option of the <STRONG>tput</STRONG> program, each time the |
| 1905 | user logs in. They will be printed in the following order: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1906 | |
| 1907 | run the program |
| 1908 | <STRONG>iprog</STRONG> |
| 1909 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1910 | output |
| 1911 | <STRONG>is1</STRONG> and |
| 1912 | <STRONG>is2</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1913 | |
| 1914 | set the margins using |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1915 | <STRONG>mgc</STRONG> or |
| 1916 | <STRONG>smglp</STRONG> and <STRONG>smgrp</STRONG> or |
| 1917 | <STRONG>smgl</STRONG> and <STRONG>smgr</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1918 | |
| 1919 | set tabs using |
| 1920 | <STRONG>tbc</STRONG> and <STRONG>hts</STRONG> |
| 1921 | |
| 1922 | print the file |
| 1923 | <STRONG>if</STRONG> |
| 1924 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1925 | and finally output |
| 1926 | <STRONG>is3</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1927 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1928 | Most initialization is done with <STRONG>is2</STRONG>. Special terminal modes can be |
| 1929 | set up without duplicating strings by putting the common sequences in |
| 1930 | <STRONG>is2</STRONG> and special cases in <STRONG>is1</STRONG> and <STRONG>is3</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1931 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1932 | A set of sequences that does a harder reset from a totally unknown |
| 1933 | state can be given as <STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rf</STRONG> and <STRONG>rs3</STRONG>, analogous to <STRONG>is1</STRONG> <STRONG>,</STRONG> <STRONG>is2</STRONG> <STRONG>,</STRONG> <STRONG>if</STRONG> |
| 1934 | and <STRONG>is3</STRONG> respectively. These strings are output by <EM>reset</EM> option of |
| 1935 | <STRONG>tput</STRONG>, or by the <STRONG>reset</STRONG> program (an alias of <STRONG>tset</STRONG>), which is used when |
| 1936 | the terminal gets into a wedged state. Commands are normally placed in |
| 1937 | <STRONG>rs1</STRONG>, <STRONG>rs2</STRONG> <STRONG>rs3</STRONG> and <STRONG>rf</STRONG> only if they produce annoying effects on the screen |
| 1938 | and are not necessary when logging in. For example, the command to set |
| 1939 | the vt100 into 80-column mode would normally be part of <STRONG>is2</STRONG>, but it |
| 1940 | causes an annoying glitch of the screen and is not normally needed |
| 1941 | since the terminal is usually already in 80-column mode. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1942 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1943 | The <STRONG>reset</STRONG> program writes strings including <STRONG>iprog</STRONG>, etc., in the same |
| 1944 | order as the <EM>init</EM> program, using <STRONG>rs1</STRONG>, etc., instead of <STRONG>is1</STRONG>, etc. If |
| 1945 | any of <STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rs3</STRONG>, or <STRONG>rf</STRONG> reset capability strings are missing, the |
| 1946 | <STRONG>reset</STRONG> program falls back upon the corresponding initialization |
| 1947 | capability string. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1948 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1949 | If there are commands to set and clear tab stops, they can be given as |
| 1950 | <STRONG>tbc</STRONG> (clear all tab stops) and <STRONG>hts</STRONG> (set a tab stop in the current column |
| 1951 | of every row). If a more complex sequence is needed to set the tabs |
| 1952 | than can be described by this, the sequence can be placed in <STRONG>is2</STRONG> or <STRONG>if</STRONG>. |
| 1953 | |
| 1954 | The <STRONG>tput</STRONG> <STRONG>reset</STRONG> command uses the same capability strings as the <STRONG>reset</STRONG> |
| 1955 | command, although the two programs (<STRONG>tput</STRONG> and <STRONG>reset</STRONG>) provide different |
| 1956 | command-line options. |
| 1957 | |
| 1958 | In practice, these terminfo capabilities are not often used in |
| 1959 | initialization of tabs (though they are required for the <STRONG>tabs</STRONG> program): |
| 1960 | |
| 1961 | <STRONG>o</STRONG> Almost all hardware terminals (at least those which supported tabs) |
| 1962 | initialized those to every <EM>eight</EM> columns: |
| 1963 | |
| 1964 | The only exception was the AT&T 2300 series, which set tabs to |
| 1965 | every <EM>five</EM> columns. |
| 1966 | |
| 1967 | <STRONG>o</STRONG> In particular, developers of the hardware terminals which are |
| 1968 | commonly used as models for modern terminal emulators provided |
| 1969 | documentation demonstrating that <EM>eight</EM> columns were the standard. |
| 1970 | |
| 1971 | <STRONG>o</STRONG> Because of this, the terminal initialization programs <STRONG>tput</STRONG> and <STRONG>tset</STRONG> |
| 1972 | use the <STRONG>tbc</STRONG> (<STRONG>clear_all_tabs</STRONG>) and <STRONG>hts</STRONG> (<STRONG>set_tab</STRONG>) capabilities |
| 1973 | directly only when the <STRONG>it</STRONG> (<STRONG>init_tabs</STRONG>) capability is set to a value |
| 1974 | other than <EM>eight</EM>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1975 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1976 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1977 | </PRE><H3><a name="h3-Delays-and-Padding">Delays and Padding</a></H3><PRE> |
| 1978 | Many older and slower terminals do not support either XON/XOFF or DTR |
| 1979 | handshaking, including hard copy terminals and some very archaic CRTs |
| 1980 | (including, for example, DEC VT100s). These may require padding |
| 1981 | characters after certain cursor motions and screen changes. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1982 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1983 | If the terminal uses xon/xoff handshaking for flow control (that is, it |
| 1984 | automatically emits ^S back to the host when its input buffers are |
| 1985 | close to full), set <STRONG>xon</STRONG>. This capability suppresses the emission of |
| 1986 | padding. You can also set it for memory-mapped console devices |
| 1987 | effectively that do not have a speed limit. Padding information should |
| 1988 | still be included so that routines can make better decisions about |
| 1989 | relative costs, but actual pad characters will not be transmitted. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1990 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1991 | If <STRONG>pb</STRONG> (padding baud rate) is given, padding is suppressed at baud rates |
| 1992 | below the value of <STRONG>pb</STRONG>. If the entry has no padding baud rate, then |
| 1993 | whether padding is emitted or not is completely controlled by <STRONG>xon</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1994 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 1995 | If the terminal requires other than a null (zero) character as a pad, |
| 1996 | then this can be given as <STRONG>pad</STRONG>. Only the first character of the <STRONG>pad</STRONG> |
| 1997 | string is used. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1998 | |
| 1999 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2000 | </PRE><H3><a name="h3-Status-Lines">Status Lines</a></H3><PRE> |
| 2001 | Some terminals have an extra "status line" which is not normally used |
| 2002 | by software (and thus not counted in the terminal's <STRONG>lines</STRONG> capability). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2003 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2004 | The simplest case is a status line which is cursor-addressable but not |
| 2005 | part of the main scrolling region on the screen; the Heathkit H19 has a |
| 2006 | status line of this kind, as would a 24-line VT100 with a 23-line |
| 2007 | scrolling region set up on initialization. This situation is indicated |
| 2008 | by the <STRONG>hs</STRONG> capability. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2009 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2010 | Some terminals with status lines need special sequences to access the |
| 2011 | status line. These may be expressed as a string with single parameter |
| 2012 | <STRONG>tsl</STRONG> which takes the cursor to a given zero-origin column on the status |
| 2013 | line. The capability <STRONG>fsl</STRONG> must return to the main-screen cursor |
| 2014 | positions before the last <STRONG>tsl</STRONG>. You may need to embed the string values |
| 2015 | of <STRONG>sc</STRONG> (save cursor) and <STRONG>rc</STRONG> (restore cursor) in <STRONG>tsl</STRONG> and <STRONG>fsl</STRONG> to |
| 2016 | accomplish this. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2017 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2018 | The status line is normally assumed to be the same width as the width |
| 2019 | of the terminal. If this is untrue, you can specify it with the |
| 2020 | numeric capability <STRONG>wsl</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2021 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2022 | A command to erase or blank the status line may be specified as <STRONG>dsl</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2023 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2024 | The Boolean capability <STRONG>eslok</STRONG> specifies that escape sequences, tabs, |
| 2025 | etc., work ordinarily in the status line. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2026 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2027 | The <EM>ncurses</EM> implementation does not yet use any of these capabilities. |
| 2028 | They are documented here in case they ever become important. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2029 | |
| 2030 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2031 | </PRE><H3><a name="h3-Line-Graphics">Line Graphics</a></H3><PRE> |
| 2032 | Many terminals have alternate character sets useful for forms-drawing. |
| 2033 | Terminfo and <STRONG>curses</STRONG> have built-in support for most of the drawing |
| 2034 | characters supported by the VT100, with some characters from the AT&T |
| 2035 | 4410v1 added. This alternate character set may be specified by the |
| 2036 | <STRONG>acsc</STRONG> capability. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2037 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2038 | <STRONG>acsc</STRONG> |
| 2039 | <STRONG>ACS</STRONG> <STRONG>Name</STRONG> <STRONG>Value</STRONG> <STRONG>Symbol</STRONG> <STRONG>ASCII</STRONG> <STRONG>Fallback</STRONG> <STRONG>/</STRONG> <STRONG>Glyph</STRONG> <STRONG>Name</STRONG> |
| 2040 | ------------------------------------------------------------------------ |
| 2041 | <STRONG>ACS_RARROW</STRONG> 0x2b + <STRONG>></STRONG> arrow pointing right |
| 2042 | <STRONG>ACS_LARROW</STRONG> 0x2c , <STRONG><</STRONG> arrow pointing left |
| 2043 | <STRONG>ACS_UARROW</STRONG> 0x2d - <STRONG>^</STRONG> arrow pointing up |
| 2044 | <STRONG>ACS_DARROW</STRONG> 0x2e . <STRONG>v</STRONG> arrow pointing down |
| 2045 | <STRONG>ACS_BLOCK</STRONG> 0x30 0 <STRONG>#</STRONG> solid square block |
| 2046 | <STRONG>ACS_DIAMOND</STRONG> 0x60 ` <STRONG>+</STRONG> diamond |
| 2047 | <STRONG>ACS_CKBOARD</STRONG> 0x61 a <STRONG>:</STRONG> checker board (stipple) |
| 2048 | <STRONG>ACS_DEGREE</STRONG> 0x66 f <STRONG>\</STRONG> degree symbol |
| 2049 | <STRONG>ACS_PLMINUS</STRONG> 0x67 g <STRONG>#</STRONG> plus/minus |
| 2050 | <STRONG>ACS_BOARD</STRONG> 0x68 h <STRONG>#</STRONG> board of squares |
| 2051 | <STRONG>ACS_LANTERN</STRONG> 0x69 i <STRONG>#</STRONG> lantern symbol |
| 2052 | <STRONG>ACS_LRCORNER</STRONG> 0x6a j <STRONG>+</STRONG> lower right corner |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2053 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2054 | <STRONG>ACS_URCORNER</STRONG> 0x6b k <STRONG>+</STRONG> upper right corner |
| 2055 | <STRONG>ACS_ULCORNER</STRONG> 0x6c l <STRONG>+</STRONG> upper left corner |
| 2056 | <STRONG>ACS_LLCORNER</STRONG> 0x6d m <STRONG>+</STRONG> lower left corner |
| 2057 | <STRONG>ACS_PLUS</STRONG> 0x6e n <STRONG>+</STRONG> large plus or crossover |
| 2058 | <STRONG>ACS_S1</STRONG> 0x6f o <STRONG>~</STRONG> scan line 1 |
| 2059 | <STRONG>ACS_S3</STRONG> 0x70 p <STRONG>-</STRONG> scan line 3 |
| 2060 | <STRONG>ACS_HLINE</STRONG> 0x71 q <STRONG>-</STRONG> horizontal line |
| 2061 | <STRONG>ACS_S7</STRONG> 0x72 r <STRONG>-</STRONG> scan line 7 |
| 2062 | <STRONG>ACS_S9</STRONG> 0x73 s <STRONG>_</STRONG> scan line 9 |
| 2063 | <STRONG>ACS_LTEE</STRONG> 0x74 t <STRONG>+</STRONG> tee pointing right |
| 2064 | <STRONG>ACS_RTEE</STRONG> 0x75 u <STRONG>+</STRONG> tee pointing left |
| 2065 | <STRONG>ACS_BTEE</STRONG> 0x76 v <STRONG>+</STRONG> tee pointing up |
| 2066 | <STRONG>ACS_TTEE</STRONG> 0x77 w <STRONG>+</STRONG> tee pointing down |
| 2067 | <STRONG>ACS_VLINE</STRONG> 0x78 x <STRONG>|</STRONG> vertical line |
| 2068 | <STRONG>ACS_LEQUAL</STRONG> 0x79 y <STRONG><</STRONG> less-than-or-equal-to |
| 2069 | <STRONG>ACS_GEQUAL</STRONG> 0x7a z <STRONG>></STRONG> greater-than-or-equal-to |
| 2070 | <STRONG>ACS_PI</STRONG> 0x7b { <STRONG>*</STRONG> greek pi |
| 2071 | <STRONG>ACS_NEQUAL</STRONG> 0x7c | <STRONG>!</STRONG> not-equal |
| 2072 | <STRONG>ACS_STERLING</STRONG> 0x7d } <STRONG>f</STRONG> UK pound sign |
| 2073 | <STRONG>ACS_BULLET</STRONG> 0x7e ~ <STRONG>o</STRONG> bullet |
| 2074 | |
| 2075 | A few notes apply to the table itself: |
| 2076 | |
| 2077 | <STRONG>o</STRONG> X/Open Curses incorrectly states that the mapping for <EM>lantern</EM> is |
| 2078 | uppercase "I" although Unix implementations use the lowercase "i" |
| 2079 | mapping. |
| 2080 | |
| 2081 | <STRONG>o</STRONG> The DEC VT100 implemented graphics using the alternate character |
| 2082 | set feature, temporarily switching <EM>modes</EM> and sending characters in |
| 2083 | the range 0x60 (96) to 0x7e (126) (the <STRONG>acsc</STRONG> <STRONG>Value</STRONG> column in the |
| 2084 | table). |
| 2085 | |
| 2086 | <STRONG>o</STRONG> The AT&T terminal added graphics characters outside that range. |
| 2087 | |
| 2088 | Some of the characters within the range do not match the VT100; |
| 2089 | presumably they were used in the AT&T terminal: <EM>board</EM> <EM>of</EM> <EM>squares</EM> |
| 2090 | replaces the VT100 <EM>newline</EM> symbol, while <EM>lantern</EM> <EM>symbol</EM> replaces |
| 2091 | the VT100 <EM>vertical</EM> <EM>tab</EM> symbol. The other VT100 symbols for control |
| 2092 | characters (<EM>horizontal</EM> <EM>tab</EM>, <EM>carriage</EM> <EM>return</EM> and <EM>line-feed</EM>) are not |
| 2093 | (re)used in curses. |
| 2094 | |
| 2095 | The best way to define a new device's graphics set is to add a column |
| 2096 | to a copy of this table for your terminal, giving the character which |
| 2097 | (when emitted between <STRONG>smacs</STRONG>/<STRONG>rmacs</STRONG> switches) will be rendered as the |
| 2098 | corresponding graphic. Then read off the VT100/your terminal character |
| 2099 | pairs right to left in sequence; these become the ACSC string. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2100 | |
| 2101 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2102 | </PRE><H3><a name="h3-Color-Handling">Color Handling</a></H3><PRE> |
| 2103 | The curses library functions <STRONG>init_pair</STRONG> and <STRONG>init_color</STRONG> manipulate the |
| 2104 | <EM>color</EM> <EM>pairs</EM> and <EM>color</EM> <EM>values</EM> discussed in this section (see |
| 2105 | <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG> for details on these and related functions). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2106 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2107 | Most color terminals are either "Tektronix-like" or "HP-like": |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2108 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2109 | <STRONG>o</STRONG> Tektronix-like terminals have a predefined set of <EM>N</EM> colors (where <EM>N</EM> |
| 2110 | is usually 8), and can set character-cell foreground and background |
| 2111 | characters independently, mixing them into <EM>N</EM> * <EM>N</EM> color pairs. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2112 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2113 | <STRONG>o</STRONG> On HP-like terminals, the user must set each color pair up |
| 2114 | separately (foreground and background are not independently |
| 2115 | settable). Up to <EM>M</EM> color pairs may be set up from 2*<EM>M</EM> different |
| 2116 | colors. ANSI-compatible terminals are Tektronix-like. |
| 2117 | |
| 2118 | Some basic color capabilities are independent of the color method. The |
| 2119 | numeric capabilities <STRONG>colors</STRONG> and <STRONG>pairs</STRONG> specify the maximum numbers of |
| 2120 | colors and color pairs that can be displayed simultaneously. The <STRONG>op</STRONG> |
| 2121 | (original pair) string resets foreground and background colors to their |
| 2122 | default values for the terminal. The <STRONG>oc</STRONG> string resets all colors or |
| 2123 | color pairs to their default values for the terminal. Some terminals |
| 2124 | (including many PC terminal emulators) erase screen areas with the |
| 2125 | current background color rather than the power-up default background; |
| 2126 | these should have the Boolean capability <STRONG>bce</STRONG>. |
| 2127 | |
| 2128 | While the curses library works with <EM>color</EM> <EM>pairs</EM> (reflecting the |
| 2129 | inability of some devices to set foreground and background colors |
| 2130 | independently), there are separate capabilities for setting these |
| 2131 | features: |
| 2132 | |
| 2133 | <STRONG>o</STRONG> To change the current foreground or background color on a |
| 2134 | Tektronix-type terminal, use <STRONG>setaf</STRONG> (set ANSI foreground) and <STRONG>setab</STRONG> |
| 2135 | (set ANSI background) or <STRONG>setf</STRONG> (set foreground) and <STRONG>setb</STRONG> (set |
| 2136 | background). These take one parameter, the color number. The SVr4 |
| 2137 | documentation describes only <STRONG>setaf</STRONG>/<STRONG>setab</STRONG>; the XPG4 draft says that |
| 2138 | "If the terminal supports ANSI escape sequences to set background |
| 2139 | and foreground, they should be coded as <STRONG>setaf</STRONG> and <STRONG>setab</STRONG>, |
| 2140 | respectively. |
| 2141 | |
| 2142 | <STRONG>o</STRONG> If the terminal supports other escape sequences to set background |
| 2143 | and foreground, they should be coded as <STRONG>setf</STRONG> and <STRONG>setb</STRONG>, |
| 2144 | respectively. The <STRONG>vidputs</STRONG> and the <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG> functions use the |
| 2145 | <STRONG>setaf</STRONG> and <STRONG>setab</STRONG> capabilities if they are defined. |
| 2146 | |
| 2147 | The <STRONG>setaf</STRONG>/<STRONG>setab</STRONG> and <STRONG>setf</STRONG>/<STRONG>setb</STRONG> capabilities take a single numeric |
| 2148 | argument each. Argument values 0-7 of <STRONG>setaf</STRONG>/<STRONG>setab</STRONG> are portably defined |
| 2149 | as follows (the middle column is the symbolic #define available in the |
| 2150 | header for the <STRONG>curses</STRONG> or <EM>ncurses</EM> libraries). The terminal hardware is |
| 2151 | free to map these as it likes, but the RGB values indicate normal |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2152 | locations in color space. |
| 2153 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2154 | <STRONG>Color</STRONG> <STRONG>#define</STRONG> <STRONG>Value</STRONG> <STRONG>RGB</STRONG> |
| 2155 | ------------------------------------------------ |
| 2156 | black <STRONG>COLOR_BLACK</STRONG> 0 0, 0, 0 |
| 2157 | red <STRONG>COLOR_RED</STRONG> 1 max, 0, 0 |
| 2158 | green <STRONG>COLOR_GREEN</STRONG> 2 0, max, 0 |
| 2159 | yellow <STRONG>COLOR_YELLOW</STRONG> 3 max, max, 0 |
| 2160 | blue <STRONG>COLOR_BLUE</STRONG> 4 0, 0, max |
| 2161 | magenta <STRONG>COLOR_MAGENTA</STRONG> 5 max, 0, max |
| 2162 | cyan <STRONG>COLOR_CYAN</STRONG> 6 0, max, max |
| 2163 | white <STRONG>COLOR_WHITE</STRONG> 7 max, max, max |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2164 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2165 | The argument values of <STRONG>setf</STRONG>/<STRONG>setb</STRONG> historically correspond to a different |
| 2166 | mapping, i.e., |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2167 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2168 | <STRONG>Color</STRONG> <STRONG>#define</STRONG> <STRONG>Value</STRONG> <STRONG>RGB</STRONG> |
| 2169 | ------------------------------------------------ |
| 2170 | black <STRONG>COLOR_BLACK</STRONG> 0 0, 0, 0 |
| 2171 | blue <STRONG>COLOR_BLUE</STRONG> 1 0, 0, max |
| 2172 | green <STRONG>COLOR_GREEN</STRONG> 2 0, max, 0 |
| 2173 | cyan <STRONG>COLOR_CYAN</STRONG> 3 0, max, max |
| 2174 | red <STRONG>COLOR_RED</STRONG> 4 max, 0, 0 |
| 2175 | magenta <STRONG>COLOR_MAGENTA</STRONG> 5 max, 0, max |
| 2176 | yellow <STRONG>COLOR_YELLOW</STRONG> 6 max, max, 0 |
| 2177 | white <STRONG>COLOR_WHITE</STRONG> 7 max, max, max |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2178 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2179 | It is important to not confuse the two sets of color capabilities; |
| 2180 | otherwise red/blue will be interchanged on the display. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2181 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2182 | On an HP-like terminal, use <STRONG>scp</STRONG> with a color pair number parameter to |
| 2183 | set which color pair is current. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2184 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2185 | Some terminals allow the <EM>color</EM> <EM>values</EM> to be modified: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2186 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2187 | <STRONG>o</STRONG> On a Tektronix-like terminal, the capability <STRONG>ccc</STRONG> may be present to |
| 2188 | indicate that colors can be modified. If so, the <STRONG>initc</STRONG> capability |
| 2189 | will take a color number (0 to <STRONG>colors</STRONG> - 1)and three more parameters |
| 2190 | which describe the color. These three parameters default to being |
| 2191 | interpreted as RGB (Red, Green, Blue) values. If the Boolean |
| 2192 | capability <STRONG>hls</STRONG> is present, they are instead as HLS (Hue, Lightness, |
| 2193 | Saturation) indices. The ranges are terminal-dependent. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2194 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2195 | <STRONG>o</STRONG> On an HP-like terminal, <STRONG>initp</STRONG> may give a capability for changing a |
| 2196 | color pair value. It will take seven parameters; a color pair |
| 2197 | number (0 to <STRONG>max_pairs</STRONG> - 1), and two triples describing first |
| 2198 | background and then foreground colors. These parameters must be |
| 2199 | (Red, Green, Blue) or (Hue, Lightness, Saturation) depending on |
| 2200 | <STRONG>hls</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2201 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2202 | On some color terminals, colors collide with highlights. You can |
| 2203 | register these collisions with the <STRONG>ncv</STRONG> capability. This is a bit mask |
| 2204 | of attributes not to be used when colors are enabled. The |
| 2205 | correspondence with the attributes understood by <STRONG>curses</STRONG> is as follows: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2206 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2207 | <STRONG>Attribute</STRONG> <STRONG>Bit</STRONG> <STRONG>Decimal</STRONG> <STRONG>Set</STRONG> <STRONG>by</STRONG> |
| 2208 | -------------------------------------- |
| 2209 | <STRONG>A_STANDOUT</STRONG> 0 1 <STRONG>sgr</STRONG> |
| 2210 | <STRONG>A_UNDERLINE</STRONG> 1 2 <STRONG>sgr</STRONG> |
| 2211 | <STRONG>A_REVERSE</STRONG> 2 4 <STRONG>sgr</STRONG> |
| 2212 | <STRONG>A_BLINK</STRONG> 3 8 <STRONG>sgr</STRONG> |
| 2213 | <STRONG>A_DIM</STRONG> 4 16 <STRONG>sgr</STRONG> |
| 2214 | <STRONG>A_BOLD</STRONG> 5 32 <STRONG>sgr</STRONG> |
| 2215 | <STRONG>A_INVIS</STRONG> 6 64 <STRONG>sgr</STRONG> |
| 2216 | <STRONG>A_PROTECT</STRONG> 7 128 <STRONG>sgr</STRONG> |
| 2217 | <STRONG>A_ALTCHARSET</STRONG> 8 256 <STRONG>sgr</STRONG> |
| 2218 | <STRONG>A_HORIZONTAL</STRONG> 9 512 <STRONG>sgr1</STRONG> |
| 2219 | <STRONG>A_LEFT</STRONG> 10 1024 <STRONG>sgr1</STRONG> |
| 2220 | <STRONG>A_LOW</STRONG> 11 2048 <STRONG>sgr1</STRONG> |
| 2221 | <STRONG>A_RIGHT</STRONG> 12 4096 <STRONG>sgr1</STRONG> |
| 2222 | <STRONG>A_TOP</STRONG> 13 8192 <STRONG>sgr1</STRONG> |
| 2223 | <STRONG>A_VERTICAL</STRONG> 14 16384 <STRONG>sgr1</STRONG> |
| 2224 | <STRONG>A_ITALIC</STRONG> 15 32768 <STRONG>sitm</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2225 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2226 | For example, on many IBM PC consoles, the underline attribute collides |
| 2227 | with the foreground color blue and is not available in color mode. |
| 2228 | These should have an <STRONG>ncv</STRONG> capability of 2. |
| 2229 | |
| 2230 | SVr4 curses does nothing with <STRONG>ncv</STRONG>, <EM>ncurses</EM> recognizes it and optimizes |
| 2231 | the output in favor of colors. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2232 | |
| 2233 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2234 | </PRE><H3><a name="h3-Miscellaneous">Miscellaneous</a></H3><PRE> |
| 2235 | If the terminal requires other than a null (zero) character as a pad, |
| 2236 | then this can be given as pad. Only the first character of the pad |
| 2237 | string is used. If the terminal does not have a pad character, specify |
| 2238 | npc. Note that <EM>ncurses</EM> implements the termcap-compatible <STRONG>PC</STRONG> variable; |
| 2239 | though the application may set this value to something other than a |
| 2240 | null, <EM>ncurses</EM> will test <STRONG>npc</STRONG> first and use napms if the terminal has no |
| 2241 | pad character. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2242 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2243 | If the terminal can move up or down half a line, this can be indicated |
| 2244 | with <STRONG>hu</STRONG> (half-line up) and <STRONG>hd</STRONG> (half-line down). This is primarily |
| 2245 | useful for superscripts and subscripts on hard-copy terminals. If a |
| 2246 | hard-copy terminal can eject to the next page (form feed), give this as |
| 2247 | <STRONG>ff</STRONG> (usually control/L). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2248 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2249 | If there is a command to repeat a given character a given number of |
| 2250 | times (to save time transmitting a large number of identical |
| 2251 | characters) this can be indicated with the parameterized string <STRONG>rep</STRONG>. |
| 2252 | The first parameter is the character to be repeated and the second is |
| 2253 | the number of times to repeat it. Thus, tparm(repeat_char, 'x', 10) is |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2254 | the same as "xxxxxxxxxx". |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2255 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2256 | If the terminal has a settable command character, such as the TEKTRONIX |
| 2257 | 4025, this can be indicated with <STRONG>cmdch</STRONG>. A prototype command character |
| 2258 | is chosen which is used in all capabilities. This character is given |
| 2259 | in the <STRONG>cmdch</STRONG> capability to identify it. The following convention is |
| 2260 | supported on some Unix systems: The environment is to be searched for a |
| 2261 | <STRONG>CC</STRONG> variable, and if found, all occurrences of the prototype character |
| 2262 | are replaced with the character in the environment variable. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2263 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2264 | Terminal descriptions that do not represent a specific kind of known |
| 2265 | terminal, such as <EM>switch</EM>, <EM>dialup</EM>, <EM>patch</EM>, and <EM>network</EM>, should include |
| 2266 | the <STRONG>gn</STRONG> (generic) capability so that programs can complain that they do |
| 2267 | not know how to talk to the terminal. (This capability does not apply |
| 2268 | to <EM>virtual</EM> terminal descriptions for which the escape sequences are |
| 2269 | known.) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2270 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2271 | If the terminal has a "meta key" which acts as a shift key, setting the |
| 2272 | 8th bit of any character transmitted, this fact can be indicated with |
| 2273 | <STRONG>km</STRONG>. Otherwise, software will assume that the 8th bit is parity and it |
| 2274 | will usually be cleared. If strings exist to turn this "meta mode" on |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2275 | and off, they can be given as <STRONG>smm</STRONG> and <STRONG>rmm</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2276 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2277 | If the terminal has more lines of memory than will fit on the screen at |
| 2278 | once, the number of lines of memory can be indicated with <STRONG>lm</STRONG>. A value |
| 2279 | of <STRONG>lm</STRONG>#0 indicates that the number of lines is not fixed, but that there |
| 2280 | is still more memory than fits on the screen. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2281 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2282 | If the terminal is one of those supported by the Unix virtual terminal |
| 2283 | protocol, the terminal number can be given as <STRONG>vt</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2284 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2285 | Media copy strings which control an auxiliary printer connected to the |
| 2286 | terminal can be given as <STRONG>mc0</STRONG>: print the contents of the screen, <STRONG>mc4</STRONG>: |
| 2287 | turn off the printer, and <STRONG>mc5</STRONG>: turn on the printer. When the printer |
| 2288 | is on, all text sent to the terminal will be sent to the printer. It |
| 2289 | is undefined whether the text is also displayed on the terminal screen |
| 2290 | when the printer is on. A variation <STRONG>mc5p</STRONG> takes one parameter, and |
| 2291 | leaves the printer on for as many characters as the value of the |
| 2292 | parameter, then turns the printer off. The parameter should not exceed |
| 2293 | 255. All text, including <STRONG>mc4</STRONG>, is transparently passed to the printer |
| 2294 | while an <STRONG>mc5p</STRONG> is in effect. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2295 | |
| 2296 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2297 | </PRE><H3><a name="h3-Glitches-and-Brain-Damage">Glitches and Brain Damage</a></H3><PRE> |
| 2298 | Hazeltine terminals, which do not allow "~" characters to be displayed |
| 2299 | should indicate <STRONG>hz</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2300 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2301 | Terminals which ignore a line-feed immediately after an <STRONG>am</STRONG> wrap, such |
| 2302 | as the Concept and vt100, should indicate <STRONG>xenl</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2303 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2304 | If <STRONG>el</STRONG> is required to get rid of standout (instead of merely writing |
| 2305 | normal text on top of it), <STRONG>xhp</STRONG> should be given. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2306 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2307 | Teleray terminals, where tabs turn all characters moved over to blanks, |
| 2308 | should indicate <STRONG>xt</STRONG> (destructive tabs). Note: the variable indicating |
| 2309 | this is now "dest_tabs_magic_smso"; in older versions, it was |
| 2310 | teleray_glitch. This glitch is also taken to mean that it is not |
| 2311 | possible to position the cursor on top of a "magic cookie", that to |
| 2312 | erase standout mode it is instead necessary to use delete and insert |
| 2313 | line. The <EM>ncurses</EM> implementation ignores this glitch. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2314 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2315 | The Beehive Superbee, which is unable to correctly transmit the escape |
| 2316 | or control/C characters, has <STRONG>xsb</STRONG>, indicating that the f1 key is used |
| 2317 | for escape and f2 for control/C. (Only certain Superbees have this |
| 2318 | problem, depending on the ROM.) Note that in older terminfo versions, |
| 2319 | this capability was called "beehive_glitch"; it is now "no_esc_ctl_c". |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2320 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2321 | Other specific terminal problems may be corrected by adding more |
| 2322 | capabilities of the form <STRONG>x</STRONG><EM>x</EM>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2323 | |
| 2324 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2325 | </PRE><H3><a name="h3-Pitfalls-of-Long-Entries">Pitfalls of Long Entries</a></H3><PRE> |
| 2326 | Long terminfo entries are unlikely to be a problem; to date, no entry |
| 2327 | has even approached terminfo's 4096-byte string-table maximum. |
| 2328 | Unfortunately, the termcap translations are much more strictly limited |
| 2329 | (to 1023 bytes), thus termcap translations of long terminfo entries can |
| 2330 | cause problems. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2331 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2332 | The man pages for 4.3BSD and older versions of <STRONG>tgetent</STRONG> instruct the |
| 2333 | user to allocate a 1024-byte buffer for the termcap entry. The entry |
| 2334 | gets null-terminated by the termcap library, so that makes the maximum |
| 2335 | safe length for a termcap entry 1k-1 (1023) bytes. Depending on what |
| 2336 | the application and the termcap library being used does, and where in |
| 2337 | the termcap file the terminal type that <STRONG>tgetent</STRONG> is searching for is, |
| 2338 | several bad things can happen: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2339 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2340 | <STRONG>o</STRONG> some termcap libraries print a warning message, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2341 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2342 | <STRONG>o</STRONG> some exit if they find an entry that's longer than 1023 bytes, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2343 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2344 | <STRONG>o</STRONG> some neither exit nor warn, doing nothing useful, and |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2345 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2346 | <STRONG>o</STRONG> some simply truncate the entries to 1023 bytes. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2347 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2348 | Some application programs allocate more than the recommended 1K for the |
| 2349 | termcap entry; others do not. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2350 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2351 | Each termcap entry has two important sizes associated with it: before |
| 2352 | "tc" expansion, and after "tc" expansion. "tc" is the capability that |
| 2353 | tacks on another termcap entry to the end of the current one, to add on |
| 2354 | its capabilities. If a termcap entry does not use the "tc" capability, |
| 2355 | then of course the two lengths are the same. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2356 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2357 | The "before tc expansion" length is the most important one, because it |
| 2358 | affects more than just users of that particular terminal. This is the |
| 2359 | length of the entry as it exists in /etc/termcap, minus the backslash- |
| 2360 | newline pairs, which <STRONG>tgetent</STRONG> strips out while reading it. Some termcap |
| 2361 | libraries strip off the final newline, too (GNU termcap does not). Now |
| 2362 | suppose: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2363 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2364 | <STRONG>o</STRONG> a termcap entry before expansion is more than 1023 bytes long, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2365 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2366 | <STRONG>o</STRONG> and the application has only allocated a 1k buffer, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2367 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2368 | <STRONG>o</STRONG> and the termcap library (like the one in BSD/OS 1.1 and GNU) reads |
| 2369 | the whole entry into the buffer, no matter what its length, to see |
| 2370 | if it is the entry it wants, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2371 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2372 | <STRONG>o</STRONG> and <STRONG>tgetent</STRONG> is searching for a terminal type that either is the |
| 2373 | long entry, appears in the termcap file after the long entry, or |
| 2374 | does not appear in the file at all (so that <STRONG>tgetent</STRONG> has to search |
| 2375 | the whole termcap file). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2376 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2377 | Then <STRONG>tgetent</STRONG> will overwrite memory, perhaps its stack, and probably |
| 2378 | core dump the program. Programs like telnet are particularly |
| 2379 | vulnerable; modern telnets pass along values like the terminal type |
| 2380 | automatically. The results are almost as undesirable with a termcap |
| 2381 | library, like SunOS 4.1.3 and Ultrix 4.4, that prints warning messages |
| 2382 | when it reads an overly long termcap entry. If a termcap library |
| 2383 | truncates long entries, like OSF/1 3.0, it is immune to dying here but |
| 2384 | will return incorrect data for the terminal. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2385 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2386 | The "after tc expansion" length will have a similar effect to the |
| 2387 | above, but only for people who actually set <EM>TERM</EM> to that terminal type, |
| 2388 | since <STRONG>tgetent</STRONG> only does "tc" expansion once it is found the terminal |
| 2389 | type it was looking for, not while searching. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2390 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2391 | In summary, a termcap entry that is longer than 1023 bytes can cause, |
| 2392 | on various combinations of termcap libraries and applications, a core |
| 2393 | dump, warnings, or incorrect operation. If it is too long even before |
| 2394 | "tc" expansion, it will have this effect even for users of some other |
| 2395 | terminal types and users whose <EM>TERM</EM> variable does not have a termcap |
| 2396 | entry. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2397 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2398 | When in -C (translate to termcap) mode, the <EM>ncurses</EM> implementation of |
| 2399 | <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG> issues warning messages when the pre-tc length of a termcap |
| 2400 | translation is too long. The -c (check) option also checks resolved |
| 2401 | (after tc expansion) lengths. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2402 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2403 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2404 | </PRE><H2><a name="h2-FILES">FILES</a></H2><PRE> |
| 2405 | <EM>/usr/share/terminfo</EM> |
| 2406 | compiled terminal description database directory |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2407 | |
| 2408 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2409 | </PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE> |
| 2410 | Searching for terminal descriptions in <EM>$HOME/.terminfo</EM> and |
| 2411 | <EM>TERMINFO</EM><STRONG>_</STRONG><EM>DIRS</EM> is not supported by older implementations. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2412 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2413 | Some SVr4 <STRONG>curses</STRONG> implementations, and all previous to SVr4, do not |
| 2414 | interpret the %A and %O operators in parameter strings. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2415 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2416 | SVr4/XPG4 do not specify whether <STRONG>msgr</STRONG> licenses movement while in an |
| 2417 | alternate-character-set mode (such modes may, among other things, map |
| 2418 | CR and NL to characters that do not trigger local motions). The |
| 2419 | <EM>ncurses</EM> implementation ignores <STRONG>msgr</STRONG> in <STRONG>ALTCHARSET</STRONG> mode. This raises |
| 2420 | the possibility that an XPG4 implementation making the opposite |
| 2421 | interpretation may need terminfo entries made for <EM>ncurses</EM> to have <STRONG>msgr</STRONG> |
| 2422 | turned off. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2423 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2424 | The <EM>ncurses</EM> library handles insert-character and insert-character modes |
| 2425 | in a slightly non-standard way to get better update efficiency. See |
| 2426 | the <STRONG>Insert/Delete</STRONG> <STRONG>Character</STRONG> subsection above. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2427 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2428 | The parameter substitutions for <STRONG>set_clock</STRONG> and <STRONG>display_clock</STRONG> are not |
| 2429 | documented in SVr4 or X/Open Curses. They are deduced from the |
| 2430 | documentation for the AT&T 505 terminal. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2431 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2432 | Be careful assigning the <STRONG>kmous</STRONG> capability. The <EM>ncurses</EM> library wants |
| 2433 | to interpret it as <STRONG>KEY_MOUSE</STRONG>, for use by terminals and emulators like |
| 2434 | xterm that can return mouse-tracking information in the keyboard-input |
| 2435 | stream. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2436 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2437 | X/Open Curses does not mention italics. Portable applications must |
| 2438 | assume that numeric capabilities are signed 16-bit values. This |
| 2439 | includes the <EM>no</EM><STRONG>_</STRONG><EM>color</EM><STRONG>_</STRONG><EM>video</EM> (<STRONG>ncv</STRONG>) capability. The 32768 mask value |
| 2440 | used for italics with <STRONG>ncv</STRONG> can be confused with an absent or cancelled |
| 2441 | <STRONG>ncv</STRONG>. If italics should work with colors, then the <STRONG>ncv</STRONG> value must be |
| 2442 | specified, even if it is zero. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2443 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2444 | Different commercial ports of <EM>terminfo</EM> and <EM>curses</EM> support different |
| 2445 | subsets of X/Open Curses and (in some cases) different extensions. |
| 2446 | Here is a summary, accurate as of October 1995, after which the |
| 2447 | commercial Unix market contracted and lost diversity. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2448 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2449 | <STRONG>o</STRONG> SVr4, Solaris, and <EM>ncurses</EM> support all SVr4 capabilities. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2450 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2451 | <STRONG>o</STRONG> IRIX supports the SVr4 set and adds one undocumented extended |
| 2452 | string capability (<STRONG>set_pglen</STRONG>). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2453 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2454 | <STRONG>o</STRONG> SVr1 and Ultrix support a restricted subset of <EM>terminfo</EM> |
| 2455 | capabilities. The Booleans end with <STRONG>xon_xoff</STRONG>; the numerics with |
| 2456 | <STRONG>width_status_line</STRONG>; and the strings with <STRONG>prtr_non</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2457 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2458 | <STRONG>o</STRONG> HP/UX supports the SVr1 subset, plus the SVr[234] numerics |
| 2459 | <STRONG>num_labels</STRONG>, <STRONG>label_height</STRONG>, <STRONG>label_width</STRONG>, plus function keys 11 |
| 2460 | through 63, plus <STRONG>plab_norm</STRONG>, <STRONG>label_on</STRONG>, and <STRONG>label_off</STRONG>, plus a number |
| 2461 | of incompatible string table extensions. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2462 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2463 | <STRONG>o</STRONG> AIX supports the SVr1 subset, plus function keys 11 through 63, |
| 2464 | plus a number of incompatible string table extensions. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2465 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2466 | <STRONG>o</STRONG> OSF/1 supports both the SVr4 set and the AIX extensions. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2467 | |
| 2468 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2469 | </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE> |
| 2470 | Do not count on compiled (binary) <EM>terminfo</EM> entries being portable |
| 2471 | between commercial Unix systems. At least two implementations of |
| 2472 | <EM>terminfo</EM> (those of HP-UX and AIX) diverged from those of other System V |
| 2473 | Unices after SVr1, adding extension capabilities to the string table |
| 2474 | that (in the binary format) collide with subsequent System V and X/Open |
| 2475 | Curses extensions. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2476 | |
| 2477 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2478 | </PRE><H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE> |
| 2479 | Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey. Based on <EM>pcurses</EM> |
| 2480 | by Pavel Curtis. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2481 | |
| 2482 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2483 | </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE> |
| 2484 | <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>, |
| 2485 | <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG>printf(3)</STRONG>, <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>, |
| 2486 | <STRONG><A HREF="term.5.html">term(5)</A></STRONG>, <STRONG><A HREF="user_caps.5.html">user_caps(5)</A></STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2487 | |
| 2488 | |
| 2489 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2490 | ncurses 6.5 2024-04-20 <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2491 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2492 | <div class="nav"> |
| 2493 | <ul> |
| 2494 | <li><a href="#h2-NAME">NAME</a></li> |
| 2495 | <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li> |
| 2496 | <li><a href="#h2-DESCRIPTION">DESCRIPTION</a> |
| 2497 | <ul> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2498 | <li><a href="#h3-terminfo-Entry-Syntax">terminfo Entry Syntax</a></li> |
| 2499 | <li><a href="#h3-terminfo-Capabilities-Syntax">terminfo Capabilities Syntax</a></li> |
| 2500 | <li><a href="#h3-Similar-Terminals">Similar Terminals</a></li> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2501 | <li><a href="#h3-Predefined-Capabilities">Predefined Capabilities</a></li> |
| 2502 | <li><a href="#h3-User-Defined-Capabilities">User-Defined Capabilities</a></li> |
| 2503 | <li><a href="#h3-A-Sample-Entry">A Sample Entry</a></li> |
| 2504 | <li><a href="#h3-Types-of-Capabilities">Types of Capabilities</a></li> |
| 2505 | <li><a href="#h3-Fetching-Compiled-Descriptions">Fetching Compiled Descriptions</a></li> |
| 2506 | <li><a href="#h3-Preparing-Descriptions">Preparing Descriptions</a></li> |
| 2507 | <li><a href="#h3-Basic-Capabilities">Basic Capabilities</a></li> |
| 2508 | <li><a href="#h3-Parameterized-Strings">Parameterized Strings</a></li> |
| 2509 | <li><a href="#h3-Cursor-Motions">Cursor Motions</a></li> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2510 | <li><a href="#h3-Margins">Margins</a></li> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2511 | <li><a href="#h3-Area-Clears">Area Clears</a></li> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2512 | <li><a href="#h3-Insert_Delete-Line-and-Vertical-Motions">Insert/Delete Line and Vertical Motions</a></li> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2513 | <li><a href="#h3-Insert_Delete-Character">Insert/Delete Character</a></li> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2514 | <li><a href="#h3-Highlighting_Underlining_and-Visible-Bells">Highlighting, Underlining, and Visible Bells</a></li> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2515 | <li><a href="#h3-Keypad-and-Function-Keys">Keypad and Function Keys</a></li> |
| 2516 | <li><a href="#h3-Tabs-and-Initialization">Tabs and Initialization</a></li> |
| 2517 | <li><a href="#h3-Delays-and-Padding">Delays and Padding</a></li> |
| 2518 | <li><a href="#h3-Status-Lines">Status Lines</a></li> |
| 2519 | <li><a href="#h3-Line-Graphics">Line Graphics</a></li> |
| 2520 | <li><a href="#h3-Color-Handling">Color Handling</a></li> |
| 2521 | <li><a href="#h3-Miscellaneous">Miscellaneous</a></li> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2522 | <li><a href="#h3-Glitches-and-Brain-Damage">Glitches and Brain Damage</a></li> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2523 | <li><a href="#h3-Pitfalls-of-Long-Entries">Pitfalls of Long Entries</a></li> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2524 | </ul> |
| 2525 | </li> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2526 | <li><a href="#h2-FILES">FILES</a></li> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2527 | <li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li> |
| 2528 | <li><a href="#h2-PORTABILITY">PORTABILITY</a></li> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2529 | <li><a href="#h2-AUTHORS">AUTHORS</a></li> |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2530 | <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2531 | </ul> |
| 2532 | </div> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 2533 | </BODY> |
| 2534 | </HTML> |