{
    "content": [
        {
            "type": "text",
            "text": "# termcap(5) (man)\n\n**Summary:** termcap - terminal capability database\n\n## See Also\n\n- ncurses(3)\n- terminfo(5)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (40 lines) — 3 subsections\n  - Boolean capabilities (28 lines)\n  - Numeric capabilities (20 lines)\n  - String capabilities (305 lines)\n- **SEE ALSO** (2 lines)\n- **COLOPHON** (7 lines)\n\n## Full Content\n\n### NAME\n\ntermcap - terminal capability database\n\n### DESCRIPTION\n\nThe  termcap  database  is an obsolete facility for describing the capabilities of character-\ncell terminals and printers.  It is retained only for compatibility with  old  programs;  new\nprograms should use the terminfo(5) database and associated libraries.\n\n/etc/termcap  is an ASCII file (the database master) that lists the capabilities of many dif‐\nferent types of terminals.  Programs can read termcap to find  the  particular  escape  codes\nneeded  to  control the visual attributes of the terminal actually in use.  (Other aspects of\nthe terminal are handled by stty(1).)  The termcap database is indexed on the  TERM  environ‐\nment variable.\n\nTermcap  entries must be defined on a single logical line, with '\\' used to suppress the new‐\nline.  Fields are separated by ':'.  The first field of each entry starts  at  the  left-hand\nmargin, and contains a list of names for the terminal, separated by '|'.\n\nThe first subfield may (in BSD termcap entries from versions 4.3 and earlier) contain a short\nname consisting of two characters.  This short name may consist of capital or small  letters.\nIn 4.4BSD, termcap entries this field is omitted.\n\nThe  second  subfield (first, in the newer 4.4BSD format) contains the name used by the envi‐\nronment variable TERM.  It should be spelled in lowercase letters.  Selectable hardware capa‐\nbilities  should be marked by appending a hyphen and a suffix to this name.  See below for an\nexample.  Usual suffixes are w (more than 80 characters wide), am  (automatic  margins),  nam\n(no  automatic  margins), and rv (reverse video display).  The third subfield contains a long\nand descriptive name for this termcap entry.\n\nSubsequent fields contain the terminal capabilities; any continued capability lines  must  be\nindented one tab from the left margin.\n\nAlthough there is no defined order, it is suggested to write first boolean, then numeric, and\nthen string capabilities, each sorted alphabetically without looking at lower or upper spell‐\ning.  Capabilities of similar functions can be written in one line.\n\nExample for:\n\nHead line: vt|vt101|DEC VT 101 terminal in 80 character mode:\\\nHead line: Vt|vt101-w|DEC VT 101 terminal in (wide) 132 character mode:\\\nBoolean: :bs:\\\nNumeric: :co#80:\\\nString: :sr=\\E[H:\\\n\n#### Boolean capabilities\n\n5i   Printer will not echo on screen\nam   Automatic margins which means automatic line wrap\nbs   Control-H (8 dec.) performs a backspace\nbw   Backspace on left margin wraps to previous line and right margin\nda   Display retained above screen\ndb   Display retained below screen\neo   A space erases all characters at cursor position\nes   Escape sequences and special characters work in status line\ngn   Generic device\nhc   This is a hardcopy terminal\nHC   The cursor is hard to see when not on bottom line\nhs   Has a status line\nhz   Hazeltine bug, the terminal can not print tilde characters\nin   Terminal inserts null bytes, not spaces, to fill whitespace\nkm   Terminal has a meta key\nmi   Cursor movement works in insert mode\nms   Cursor movement works in standout/underline mode\nNP   No pad character\nNR   ti does not reverse te\nnx   No padding, must use XON/XOFF\nos   Terminal can overstrike\nul   Terminal underlines although it can not overstrike\nxb   Beehive glitch, f1 sends ESCAPE, f2 sends ^C\nxn   Newline/wraparound glitch\nxo   Terminal uses xon/xoff protocol\nxs   Text typed over standout text will be displayed in standout\nxt   Teleray glitch, destructive tabs and odd standout mode\n\n#### Numeric capabilities\n\nco   Number of columns\ndB   Delay in milliseconds for backspace on hardcopy terminals\ndC   Delay in milliseconds for carriage return on hardcopy terminals\ndF   Delay in milliseconds for form feed on hardcopy terminals\ndN   Delay in milliseconds for new line on hardcopy terminals\ndT   Delay in milliseconds for tabulator stop on hardcopy terminals\ndV   Delay in milliseconds for vertical tabulator stop on\nhardcopy terminals\nit   Difference between tab positions\nlh   Height of soft labels\nlm   Lines of memory\nlw   Width of soft labels\nli   Number of lines\nNl   Number of soft labels\npb   Lowest baud rate which needs padding\nsg   Standout glitch\nug   Underline glitch\nvt   virtual terminal number\nws   Width of status line if different from screen width\n\n#### String capabilities\n\n!1   shifted save key\n!2   shifted suspend key\n!3   shifted undo key\n#1   shifted help key\n#2   shifted home key\n#3   shifted input key\n#4   shifted cursor left key\n%0   redo key\n%1   help key\n%2   mark key\n%3   message key\n%4   move key\n%5   next-object key\n%6   open key\n%7   options key\n%8   previous-object key\n%9   print key\n%a   shifted message key\n%b   shifted move key\n%c   shifted next key\n%d   shifted options key\n%e   shifted previous key\n%f   shifted print key\n%g   shifted redo key\n%h   shifted replace key\n%i   shifted cursor right key\n%j   shifted resume key\n&0   shifted cancel key\n&1   reference key\n&2   refresh key\n&3   replace key\n&4   restart key\n&5   resume key\n&6   save key\n&7   suspend key\n&8   undo key\n&9   shifted begin key\n*0   shifted find key\n*1   shifted command key\n*2   shifted copy key\n*3   shifted create key\n*4   shifted delete character\n*5   shifted delete line\n*6   select key\n*7   shifted end key\n*8   shifted clear line key\n*9   shifted exit key\n@0   find key\n@1   begin key\n@2   cancel key\n@3   close key\n@4   command key\n@5   copy key\n@6   create key\n@7   end key\n@8   enter/send key\n@9   exit key\nal   Insert one line\nAL   Insert %1 lines\nac   Pairs of block graphic characters to map alternate character set\nae   End alternative character set\nas   Start alternative character set for block graphic characters\nbc   Backspace, if not ^H\nbl   Audio bell\nbt   Move to previous tab stop\ncb   Clear from beginning of line to cursor\ncc   Dummy command character\ncd   Clear to end of screen\nce   Clear to end of line\nch   Move cursor horizontally only to column %1\ncl   Clear screen and cursor home\ncm   Cursor move to row %1 and column %2 (on screen)\nCM   Move cursor to row %1 and column %2 (in memory)\ncr   Carriage return\ncs   Scroll region from line %1 to %2\nct   Clear tabs\ncv   Move cursor vertically only to line %1\ndc   Delete one character\nDC   Delete %1 characters\ndl   Delete one line\nDL   Delete %1 lines\ndm   Begin delete mode\ndo   Cursor down one line\nDO   Cursor down #1 lines\nds   Disable status line\neA   Enable alternate character set\nec   Erase %1 characters starting at cursor\ned   End delete mode\nei   End insert mode\nff   Formfeed character on hardcopy terminals\nfs   Return character to its position before going to status line\nF1   The string sent by function key f11\nF2   The string sent by function key f12\nF3   The string sent by function key f13\n...  ...\nF9   The string sent by function key f19\nFA   The string sent by function key f20\nFB   The string sent by function key f21\n...  ...\nFZ   The string sent by function key f45\nFa   The string sent by function key f46\nFb   The string sent by function key f47\n...  ...\nFr   The string sent by function key f63\nhd   Move cursor a half line down\nho   Cursor home\nhu   Move cursor a half line up\ni1   Initialization string 1 at login\ni3   Initialization string 3 at login\nis   Initialization string 2 at login\nic   Insert one character\nIC   Insert %1 characters\nif   Initialization file\nim   Begin insert mode\nip   Insert pad time and needed special characters after insert\niP   Initialization program\nK1   upper left key on keypad\nK2   center key on keypad\nK3   upper right key on keypad\nK4   bottom left key on keypad\nK5   bottom right key on keypad\nk0   Function key 0\nk1   Function key 1\nk2   Function key 2\nk3   Function key 3\nk4   Function key 4\nk5   Function key 5\nk6   Function key 6\nk7   Function key 7\nk8   Function key 8\nk9   Function key 9\nk;   Function key 10\nka   Clear all tabs key\nkA   Insert line key\nkb   Backspace key\nkB   Back tab stop\nkC   Clear screen key\nkd   Cursor down key\nkD   Key for delete character under cursor\nke   turn keypad off\nkE   Key for clear to end of line\nkF   Key for scrolling forward/down\nkh   Cursor home key\nkH   Cursor hown down key\nkI   Insert character/Insert mode key\nkl   Cursor left key\nkL   Key for delete line\nkM   Key for exit insert mode\nkN   Key for next page\nkP   Key for previous page\nkr   Cursor right key\nkR   Key for scrolling backward/up\nks   Turn keypad on\nkS   Clear to end of screen key\nkt   Clear this tab key\nkT   Set tab here key\nku   Cursor up key\nl0   Label of zeroth function key, if not f0\nl1   Label of first function key, if not f1\nl2   Label of first function key, if not f2\n...  ...\nla   Label of tenth function key, if not f10\nle   Cursor left one character\nll   Move cursor to lower left corner\nLE   Cursor left %1 characters\nLF   Turn soft labels off\nLO   Turn soft labels on\nmb   Start blinking\nMC   Clear soft margins\nmd   Start bold mode\nme   End all mode like so, us, mb, md, and mr\nmh   Start half bright mode\nmk   Dark mode (Characters invisible)\nML   Set left soft margin\nmm   Put terminal in meta mode\nmo   Put terminal out of meta mode\nmp   Turn on protected attribute\nmr   Start reverse mode\nMR   Set right soft margin\nnd   Cursor right one character\nnw   Carriage return command\npc   Padding character\npf   Turn printer off\npk   Program key %1 to send string %2 as if typed by user\npl   Program key %1 to execute string %2 in local mode\npn   Program soft label %1 to show string %2\npo   Turn the printer on\npO   Turn the printer on for %1 (<256) bytes\nps   Print screen contents on printer\npx   Program key %1 to send string %2 to computer\nr1   Reset string 1 to set terminal to sane modes\nr2   Reset string 2 to set terminal to sane modes\nr3   Reset string 3 to set terminal to sane modes\nRA   disable automatic margins\nrc   Restore saved cursor position\nrf   Reset string filename\nRF   Request for input from terminal\nRI   Cursor right %1 characters\nrp   Repeat character %1 for %2 times\nrP   Padding after character sent in replace mode\nrs   Reset string\nRX   Turn off XON/XOFF flow control\nsa   Set %1 %2 %3 %4 %5 %6 %7 %8 %9 attributes\nSA   enable automatic margins\nsc   Save cursor position\nse   End standout mode\nsf   Normal scroll one line\nSF   Normal scroll %1 lines\nso   Start standout mode\nsr   Reverse scroll\nSR   scroll back %1 lines\nst   Set tabulator stop in all rows at current column\nSX   Turn on XON/XOFF flow control\nta   move to next hardware tab\ntc   Read in terminal description from another entry\nte   End program that uses cursor motion\nti   Begin program that uses cursor motion\nts   Move cursor to column %1 of status line\nuc   Underline character under cursor and move cursor right\nue   End underlining\nup   Cursor up one line\nUP   Cursor up %1 lines\nus   Start underlining\nvb   Visible bell\nve   Normal cursor visible\nvi   Cursor invisible\nvs   Standout cursor\nwi   Set window from line %1 to %2 and column %3 to %4\nXF   XOFF character if not ^S\n\nThere are several ways of defining the control codes for string capabilities:\n\nEvery normal character represents itself, except '^', '\\', and '%'.\n\nA ^x means Control-x.  Control-A equals 1 decimal.\n\n\\x means a special code.  x can be one of the following characters:\nE Escape (27)\nn Linefeed (10)\nr Carriage return (13)\nt Tabulation (9)\nb Backspace (8)\nf Form feed (12)\n0 Null character.  A \\xxx specifies the octal character xxx.\n\ni      Increments parameters by one.\n\nr      Single parameter capability\n\n+      Add value of next character to this parameter and do binary output\n\n2      Do ASCII output of this parameter with a field with of 2\n\nd      Do ASCII output of this parameter with a field with of 3\n\n%      Print a '%'\n\nIf  you  use binary output, then you should avoid the null character ('\\0') because it termi‐\nnates the string.  You should reset tabulator expansion if a tabulator can be the binary out‐\nput of a parameter.\n\nWarning:\nThe  above  metacharacters  for  parameters  may be wrong: they document Minix termcap\nwhich may not be compatible with Linux termcap.\n\nThe block graphic characters can be specified by three string capabilities:\n\nas     start the alternative charset\n\nae     end the alternative charset\n\nac     pairs of characters.  The first character is the name of the block graphic symbol  and\nthe second characters is its definition.\n\nThe following names are available:\n\n+    right arrow (>)\n,    left arrow (<)\n.    down arrow (v)\n0    full square (#)\nI    lantern (#)\n-    upper arrow (^)\n'    rhombus (+)\na    chess board (:)\nf    degree (')\ng    plus-minus (#)\nh    square (#)\nj    right bottom corner (+)\nk    right upper corner (+)\nl    left upper corner (+)\nm    left bottom corner (+)\nn    cross (+)\no    upper horizontal line (-)\nq    middle horizontal line (-)\ns    bottom horizontal line ()\nt    left tee (+)\nu    right tee (+)\nv    bottom tee (+)\nw    normal tee (+)\nx    vertical line (|)\n~    paragraph (???)\n\nThe values in parentheses are suggested defaults which are used by the curses library, if the\ncapabilities are missing.\n\n### SEE ALSO\n\nncurses(3), termcap(3), terminfo(5)\n\n### COLOPHON\n\nThis page is part of release 5.10 of the Linux  man-pages  project.   A  description  of  the\nproject,  information about reporting bugs, and the latest version of this page, can be found\nat https://www.kernel.org/doc/man-pages/.\n\n\n\nLinux                                        2020-08-13                                   TERMCAP(5)\n\n"
        }
    ],
    "structuredContent": {
        "command": "termcap",
        "section": "5",
        "mode": "man",
        "summary": "termcap - terminal capability database",
        "synopsis": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "ncurses",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/ncurses/3/json"
            },
            {
                "name": "terminfo",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/terminfo/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 40,
                "subsections": [
                    {
                        "name": "Boolean capabilities",
                        "lines": 28
                    },
                    {
                        "name": "Numeric capabilities",
                        "lines": 20
                    },
                    {
                        "name": "String capabilities",
                        "lines": 305
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COLOPHON",
                "lines": 7,
                "subsections": []
            }
        ]
    }
}