{
    "mode": "man",
    "parameter": "terminfo",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/terminfo/5/json",
    "generated": "2026-11-08T06:30:25Z",
    "synopsis": "/etc/terminfo/*/*",
    "sections": {
        "NAME": {
            "content": "terminfo - terminal capability database\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "/etc/terminfo/*/*\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Terminfo is a database describing terminals, used by screen-oriented programs such as nvi(1),\nlynx(1),  mutt(1), and other curses applications, using high-level calls to libraries such as\nncurses(3NCURSES).  It is also used via low-level calls by non-curses applications which  may\nbe screen-oriented (such as clear(1)) or non-screen (such as tabs(1)).\n\nTerminfo  describes  terminals by giving a set of capabilities which they have, by specifying\nhow to perform screen operations, and by specifying padding requirements  and  initialization\nsequences.\n\nThis manual describes ncurses version 6.4 (patch 20240113).\n\nterminfo Entry Syntax\nEntries in terminfo consist of a sequence of fields:\n\n•   Each  field  ends  with  a  comma “,” (embedded commas may be escaped with a backslash or\nwritten as “\\054”).\n\n•   White space between fields is ignored.\n\n•   The first field in a terminfo entry begins in the first column.\n\n•   Newlines and leading whitespace (spaces or tabs) may be used for formatting  entries  for\nreadability.  These are removed from parsed entries.\n\nThe  infocmp -f and -W options rely on this to format if-then-else expressions, or to en‐\nforce maximum line-width.  The resulting formatted terminal description can  be  read  by\ntic.\n\n•   The first field for each terminal gives the names which are known for the terminal, sepa‐\nrated by “|” characters.\n\nThe first name given is the most common abbreviation for the terminal (its primary name),\nthe  last  name  given  should  be  a  long  name  fully  identifying  the  terminal (see\nlongname(3NCURSES)), and all others are treated as synonyms  (aliases)  for  the  primary\nterminal name.\n\nX/Open  Curses advises that all names but the last should be in lower case and contain no\nblanks; the last name may well contain upper case and blanks for readability.\n\nThis implementation is not so strict; it allows  mixed  case  in  the  primary  name  and\naliases.  If the last name has no embedded blanks, it allows that to be both an alias and\na verbose name (but will warn about this ambiguity).\n\n•   Lines beginning with a “#” in the first column are treated as comments.\n\nWhile  comment  lines  are  valid  at  any  point,  the output of captoinfo and infotocap\n(aliases for tic) will move comments so they occur only between entries.\n\nTerminal names (except for the last, verbose entry) should be chosen using the following con‐\nventions.  The particular piece of hardware making up the terminal should have a  root  name,\nthus  “hp2621”.  This name should not contain hyphens.  Modes that the hardware can be in, or\nuser preferences, should be indicated by appending a hyphen and a mode suffix.  Thus, a vt100\nin 132-column mode would be vt100-w.  The following suffixes should be used where possible:\n",
            "subsections": [
                {
                    "name": "Suffix   Example     Meaning",
                    "content": "──────────────────────────────────────────────────────────────────────────────────────────────\n-nn      aaa-60      Number of lines on the screen\n-np      c100-4p     Number of pages of memory\n-am      vt100-am    With automargins (usually the default)\n-m       ansi-m      Mono mode; suppress color\n-mc      wy30-mc     Magic cookie; spaces when highlighting\n-na      c100-na     No arrow keys (leave them in local)\n-nam     vt100-nam   Without automatic margins\n-nl      hp2621-nl   No status line\n-ns      hp2626-ns   No status line\n-rv      c100-rv     Reverse video\n-s       vt100-s     Enable status line\n-vb      wy370-vb    Use visible bell instead of beep\n-w       vt100-w     Wide mode (> 80 columns, usually 132)\n\nFor more on terminal naming conventions, see the term(7) manual page.\n\nterminfo Capabilities Syntax\nThe terminfo entry consists of several capabilities, i.e., features that the terminal has, or\nmethods for exercising the terminal's features.\n\nAfter the first field (giving the name(s) of the terminal entry), there should be one or more\ncapability fields.  These are Boolean, numeric or string names with corresponding values:\n\n•   Boolean capabilities are true when present, false when  absent.   There  is  no  explicit\nvalue for Boolean capabilities.\n\n•   Numeric  capabilities  have  a  “#”  following the name, then an unsigned decimal integer\nvalue.\n\n•   String capabilities have a “=” following the name, then an string of characters making up\nthe capability value.\n\nString capabilities can be split into multiple lines, just as  the  fields  comprising  a\nterminal  entry  can  be  split into multiple lines.  While blanks between fields are ig‐\nnored, blanks embedded within a string value are retained, except for leading blanks on a\nline.\n\nAny capability can be canceled, i.e., suppressed from the terminal entry,  by  following  its\nname with “@” rather than a capability value.\n"
                },
                {
                    "name": "Similar Terminals",
                    "content": "If  there are two very similar terminals, one (the variant) can be defined as being just like\nthe other (the base) with certain exceptions.  In the definition of the variant,  the  string\ncapability use can be given with the name of the base terminal:\n\n•   The capabilities given before use override those in the base type named by use.\n\n•   If  there  are multiple use capabilities, they are merged in reverse order.  That is, the\nrightmost use reference is processed first, then the one to its left, and so forth.\n\n•   Capabilities given explicitly in the entry override those brought in by use references.\n\nA capability can be canceled by placing xx@ to the left of the use reference that imports it,\nwhere xx is the capability.  For example, the entry\n\n2621-nl, smkx@, rmkx@, use=2621,\n\ndefines a 2621-nl that does not have the smkx or rmkx capabilities, and hence does  not  turn\non  the  function  key  labels when in visual mode.  This is useful for different modes for a\nterminal, or for different user preferences.\n\nAn entry included via use can contain canceled capabilities, which have the same effect as if\nthose cancels were inline in the using terminal entry.\n"
                },
                {
                    "name": "Predefined Capabilities",
                    "content": "The following is a complete table of the capabilities  included  in  a  terminfo  description\nblock and available to terminfo-using code.  In each line of the table,\n\n•   The variable is the name by which the programmer (at the terminfo level) accesses the ca‐\npability.\n\n•   The capname (Cap-name) is the short name used in the text of the database, and is used by\na person updating the database.\n\nWhenever  possible,  capnames  are  chosen  to  be  the  same  as  or similar to the ANSI\nX3.64-1979 standard (now superseded by ECMA-48, which  uses  identical  or  very  similar\nnames).  Semantics are also intended to match those of the specification.\n\nCapability  names  have  no  hard length limit, but an informal limit of 5 characters has\nbeen adopted to keep them short and to allow the tabs in the source file Caps to line  up\nnicely.\n\n•   The  termcap  (Tcap) code is the old capability name (some capabilities are new, and have\nnames which termcap did not originate).\n\n•   Finally, the description field attempts to convey the semantics of the capability.\n\nYou may find some codes in the description field:\n\n(P)    indicates that padding may be specified\n\n#[1-9] in the description field indicates that the string is passed  through  tparm(3NCURSES)\nwith parameters as given (#i).\n\nIf   no  parameters  are  listed  in  the  description,  passing  the  string  through\ntparm(3NCURSES) may give unexpected results, e.g., if it contains percent (%%) signs.\n\n(P*)   indicates that padding may vary in proportion to the number of lines affected\n\n(#i)   indicates the ith parameter.\n\nCode"
                },
                {
                    "name": "Boolean Capability Name    TI      TC   Description",
                    "content": "──────────────────────────────────────────────────────────────────────────────────────────────\nautoleftmargin           bw      bw   cub1 wraps from column 0 to last column\nautorightmargin          am      am   terminal has automatic margins\nnoescctlc                xsb     xb   beehive (f1=escape, f2=ctrl C)\nceolstandoutglitch       xhp     xs   standout not erased by overwriting (hp)\neatnewlineglitch         xenl    xn   newline ignored after 80 cols (concept)\neraseoverstrike           eo      eo   can erase overstrikes with a blank\ngenerictype               gn      gn   generic line type\nhardcopy                  hc      hc   hardcopy terminal\nhasmetakey               km      km   Has a meta key (i.e., sets 8th-bit)\nhasstatusline            hs      hs   has extra status line\ninsertnullglitch         in      in   insert mode distinguishes nulls\nmemoryabove               da      da   display may be retained above the screen\nmemorybelow               db      db   display may be retained below the screen\nmoveinsertmode           mir     mi   safe to move while in insert mode\nmovestandoutmode         msgr    ms   safe to move while in standout mode\noverstrike                os      os   terminal can overstrike\nstatuslineescok         eslok   es   escape can be used on the status line\ndesttabsmagicsmso       xt      xt   tabs destructive, magic so char (t1061)\ntildeglitch               hz      hz   cannot print ~'s (Hazeltine)\ntransparentunderline      ul      ul   underline character overstrikes\nxonxoff                   xon     xo   terminal uses xon/xoff handshaking\nneedsxonxoff             nxon    nx   padding will not work, xon/xoff required\nprtrsilent                mc5i    5i   printer will not echo on screen\nhardcursor                chts    HC   cursor is hard to see\nnonrevrmcup              nrrmc   NR   smcup does not reverse rmcup\nnopadchar                npc     NP   pad character does not exist\nnondestscrollregion     ndscr   ND   scrolling region is non-destructive\ncanchange                 ccc     cc   terminal can re-define existing colors\nbackcolorerase           bce     ut   screen erased with background color\nhuelightnesssaturation   hls     hl   terminal uses only HLS color notation (Tektronix)\ncoladdrglitch            xhpa    YA   only positive motion for hpa/mhpa caps\ncrcancelsmicromode      crxm    YB   using cr turns off micro mode\nhasprintwheel            daisy   YC   printer needs operator to change character set\nrowaddrglitch            xvpa    YD   only positive motion for vpa/mvpa caps\nsemiautorightmargin     sam     YE   printing in last column causes cr\ncpichangesres            cpix    YF   changing character pitch changes resolution\nlpichangesres            lpix    YG   changing line pitch changes resolution\n\nCode"
                },
                {
                    "name": "Numeric Capability Name   TI       TC   Description",
                    "content": "──────────────────────────────────────────────────────────────────────────────────────────────\ncolumns                   cols     co   number of columns in a line\ninittabs                 it       it   tabs initially every # spaces\nlines                     lines    li   number of lines on screen or page\nlinesofmemory           lm       lm   lines of memory if > line. 0 means varies\nmagiccookieglitch       xmc      sg   number of blank characters left by smso or rmso\npaddingbaudrate         pb       pb   lowest baud rate where padding needed\nvirtualterminal          vt       vt   virtual terminal number (CB/unix)\nwidthstatusline         wsl      ws   number of columns in status line\nnumlabels                nlab     Nl   number of labels on screen\nlabelheight              lh       lh   rows in each label\nlabelwidth               lw       lw   columns in each label\nmaxattributes            ma       ma   maximum combined attributes terminal can handle\nmaximumwindows           wnum     MW   maximum number of definable windows\nmaxcolors                colors   Co   maximum number of colors on screen\nmaxpairs                 pairs    pa   maximum number of color-pairs on the screen\nnocolorvideo            ncv      NC   video attributes that cannot be used with colors\n\nThe following numeric capabilities are present in the SVr4.0 term structure, but are not  yet\ndocumented in the man page.  They came in with SVr4's printer support.\n\nCode"
                },
                {
                    "name": "Numeric Capability Name   TI       TC   Description",
                    "content": "──────────────────────────────────────────────────────────────────────────────────────────────\nbuffercapacity           bufsz    Ya   numbers of bytes buffered before printing\ndotvertspacing          spinv    Yb   spacing of pins vertically in pins per inch\ndothorzspacing          spinh    Yc   spacing of dots horizontally in dots per inch\nmaxmicroaddress         maddr    Yd   maximum value in micro...address\nmaxmicrojump            mjump    Ye   maximum value in parm...micro\nmicrocolsize            mcs      Yf   character step size when in micro mode\nmicrolinesize           mls      Yg   line step size when in micro mode\nnumberofpins            npins    Yh   numbers of pins in print-head\noutputreschar           orc      Yi   horizontal resolution in units per line\noutputresline           orl      Yj   vertical resolution in units per line\noutputreshorzinch      orhi     Yk   horizontal resolution in units per inch\noutputresvertinch      orvi     Yl   vertical resolution in units per inch\nprintrate                cps      Ym   print rate in characters per second\nwidecharsize            widcs    Yn   character step size when in double wide mode\nbuttons                   btns     BT   number of buttons on mouse\nbitimageentwining       bitwin   Yo   number of passes for each bit-image row\nbitimagetype            bitype   Yp   type of bit-image device\n\nCode"
                },
                {
                    "name": "String Capability Name      TI       TC   Description",
                    "content": "──────────────────────────────────────────────────────────────────────────────────────────────\nbacktab                    cbt      bt   back tab (P)\nbell                        bel      bl   audible signal (bell) (P)\ncarriagereturn             cr       cr   carriage return (P*) (P*)\nchangescrollregion        csr      cs   change region to line #1 to line #2 (P)\nclearalltabs              tbc      ct   clear all tab stops (P)\nclearscreen                clear    cl   clear screen and home cursor (P*)\nclreol                     el       ce   clear to end of line (P)\nclreos                     ed       cd   clear to end of screen (P*)\ncolumnaddress              hpa      ch   horizontal position #1, absolute (P)\ncommandcharacter           cmdch    CC   terminal settable cmd character in prototype !?\ncursoraddress              cup      cm   move to row #1 columns #2\ncursordown                 cud1     do   down one line\ncursorhome                 home     ho   home cursor (if no cup)\ncursorinvisible            civis    vi   make cursor invisible\ncursorleft                 cub1     le   move left one space\ncursormemaddress          mrcup    CM   memory relative cursor addressing, move to row #1\ncolumns #2\ncursornormal               cnorm    ve   make cursor appear normal (undo civis/cvvis)\ncursorright                cuf1     nd   non-destructive space (move right one space)\ncursortoll                ll       ll   last line, first column (if no cup)\ncursorup                   cuu1     up   up one line\ncursorvisible              cvvis    vs   make cursor very visible\ndeletecharacter            dch1     dc   delete character (P*)\ndeleteline                 dl1      dl   delete line (P*)\ndisstatusline             dsl      ds   disable status line\ndownhalfline              hd       hd   half a line down\nenteraltcharsetmode      smacs    as   start alternate character set (P)\nenterblinkmode            blink    mb   turn on blinking\nenterboldmode             bold     md   turn on bold (extra bright) mode\nentercamode               smcup    ti   string to start programs using cup\nenterdeletemode           smdc     dm   enter delete mode\nenterdimmode              dim      mh   turn on half-bright mode\nenterinsertmode           smir     im   enter insert mode\nentersecuremode           invis    mk   turn on blank mode (characters invisible)\nenterprotectedmode        prot     mp   turn on protected mode\nenterreversemode          rev      mr   turn on reverse video mode\nenterstandoutmode         smso     so   begin standout mode\nenterunderlinemode        smul     us   begin underline mode\nerasechars                 ech      ec   erase #1 characters (P)\nexitaltcharsetmode       rmacs    ae   end alternate character set (P)\nexitattributemode         sgr0     me   turn off all attributes\nexitcamode                rmcup    te   strings to end programs using cup\nexitdeletemode            rmdc     ed   end delete mode\nexitinsertmode            rmir     ei   exit insert mode\nexitstandoutmode          rmso     se   exit standout mode\nexitunderlinemode         rmul     ue   exit underline mode\nflashscreen                flash    vb   visible bell (may not move cursor)\nformfeed                   ff       ff   hardcopy terminal page eject (P*)\nfromstatusline            fsl      fs   return from status line\ninit1string                is1      i1   initialization string\ninit2string                is2      is   initialization string\ninit3string                is3      i3   initialization string\ninitfile                   if       if   name of initialization file\ninsertcharacter            ich1     ic   insert character (P)\ninsertline                 il1      al   insert line (P*)\ninsertpadding              ip       ip   insert padding after inserted character\nkeybackspace               kbs      kb   backspace key\nkeycatab                   ktbc     ka   clear-all-tabs key\nkeyclear                   kclr     kC   clear-screen or erase key\nkeyctab                    kctab    kt   clear-tab key\nkeydc                      kdch1    kD   delete-character key\nkeydl                      kdl1     kL   delete-line key\nkeydown                    kcud1    kd   down-arrow key\nkeyeic                     krmir    kM   sent by rmir or smir in insert mode\nkeyeol                     kel      kE   clear-to-end-of-line key\nkeyeos                     ked      kS   clear-to-end-of-screen key\nkeyf0                      kf0      k0   F0 function key\nkeyf1                      kf1      k1   F1 function key\nkeyf10                     kf10     k;   F10 function key\nkeyf2                      kf2      k2   F2 function key\nkeyf3                      kf3      k3   F3 function key\nkeyf4                      kf4      k4   F4 function key\nkeyf5                      kf5      k5   F5 function key\nkeyf6                      kf6      k6   F6 function key\nkeyf7                      kf7      k7   F7 function key\nkeyf8                      kf8      k8   F8 function key\nkeyf9                      kf9      k9   F9 function key\nkeyhome                    khome    kh   home key\nkeyic                      kich1    kI   insert-character key\nkeyil                      kil1     kA   insert-line key\nkeyleft                    kcub1    kl   left-arrow key\nkeyll                      kll      kH   lower-left key (home down)\nkeynpage                   knp      kN   next-page key\nkeyppage                   kpp      kP   previous-page key\nkeyright                   kcuf1    kr   right-arrow key\nkeysf                      kind     kF   scroll-forward key\nkeysr                      kri      kR   scroll-backward key\nkeystab                    khts     kT   set-tab key\nkeyup                      kcuu1    ku   up-arrow key\nkeypadlocal                rmkx     ke   leave keyboard transmit mode\nkeypadxmit                 smkx     ks   enter keyboard transmit mode\nlabf0                      lf0      l0   label on function key f0 if not f0\nlabf1                      lf1      l1   label on function key f1 if not f1\nlabf10                     lf10     la   label on function key f10 if not f10\nlabf2                      lf2      l2   label on function key f2 if not f2\nlabf3                      lf3      l3   label on function key f3 if not f3\nlabf4                      lf4      l4   label on function key f4 if not f4\nlabf5                      lf5      l5   label on function key f5 if not f5\nlabf6                      lf6      l6   label on function key f6 if not f6\nlabf7                      lf7      l7   label on function key f7 if not f7\nlabf8                      lf8      l8   label on function key f8 if not f8\nlabf9                      lf9      l9   label on function key f9 if not f9\nmetaoff                    rmm      mo   turn off meta mode\nmetaon                     smm      mm   turn on meta mode (8th-bit on)\nnewline                     nel      nw   newline (behave like cr followed by lf)\npadchar                    pad      pc   padding char (instead of null)\nparmdch                    dch      DC   delete #1 characters (P*)\nparmdeleteline            dl       DL   delete #1 lines (P*)\nparmdowncursor            cud      DO   down #1 lines (P*)\nparmich                    ich      IC   insert #1 characters (P*)\nparmindex                  indn     SF   scroll forward #1 lines (P)\nparminsertline            il       AL   insert #1 lines (P*)\nparmleftcursor            cub      LE   move #1 characters to the left (P)\nparmrightcursor           cuf      RI   move #1 characters to the right (P*)\nparmrindex                 rin      SR   scroll back #1 lines (P)\nparmupcursor              cuu      UP   up #1 lines (P*)\npkeykey                    pfkey    pk   program function key #1 to type string #2\npkeylocal                  pfloc    pl   program function key #1 to execute string #2\npkeyxmit                   pfx      px   program function key #1 to transmit string #2\nprintscreen                mc0      ps   print contents of screen\nprtroff                    mc4      pf   turn off printer\nprtron                     mc5      po   turn on printer\nrepeatchar                 rep      rp   repeat char #1 #2 times (P*)\nreset1string               rs1      r1   reset string\nreset2string               rs2      r2   reset string\nreset3string               rs3      r3   reset string\nresetfile                  rf       rf   name of reset file\nrestorecursor              rc       rc   restore cursor to position of last savecursor\nrowaddress                 vpa      cv   vertical position #1 absolute (P)\nsavecursor                 sc       sc   save current cursor position (P)\nscrollforward              ind      sf   scroll text up (P)\nscrollreverse              ri       sr   scroll text down (P)\nsetattributes              sgr      sa   define video attributes #1-#9 (PG9)\nsettab                     hts      st   set a tab in every row, current columns\nsetwindow                  wind     wi   current window is lines #1-#2 cols #3-#4\ntab                         ht       ta   tab to next 8-space hardware tab stop\ntostatusline              tsl      ts   move to status line, column #1\nunderlinechar              uc       uc   underline char and move past it\nuphalfline                hu       hu   half a line up\ninitprog                   iprog    iP   path name of program for initialization\nkeya1                      ka1      K1   upper left of keypad\nkeya3                      ka3      K3   upper right of keypad\nkeyb2                      kb2      K2   center of keypad\nkeyc1                      kc1      K4   lower left of keypad\nkeyc3                      kc3      K5   lower right of keypad\nprtrnon                    mc5p     pO   turn on printer for #1 bytes\ncharpadding                rmp      rP   like ip but when in insert mode\nacschars                   acsc     ac   graphics charset pairs, based on vt100\nplabnorm                   pln      pn   program label #1 to show string #2\nkeybtab                    kcbt     kB   back-tab key\nenterxonmode              smxon    SX   turn on xon/xoff handshaking\nexitxonmode               rmxon    RX   turn off xon/xoff handshaking\nenterammode               smam     SA   turn on automatic margins\nexitammode                rmam     RA   turn off automatic margins\nxoncharacter               xonc     XN   XON character\nxoffcharacter              xoffc    XF   XOFF character\nenaacs                     enacs    eA   enable alternate char set\nlabelon                    smln     LO   turn on soft labels\nlabeloff                   rmln     LF   turn off soft labels\nkeybeg                     kbeg     @1   begin key\nkeycancel                  kcan     @2   cancel key\nkeyclose                   kclo     @3   close key\nkeycommand                 kcmd     @4   command key\nkeycopy                    kcpy     @5   copy key\nkeycreate                  kcrt     @6   create key\nkeyend                     kend     @7   end key\nkeyenter                   kent     @8   enter/send key\nkeyexit                    kext     @9   exit key\nkeyfind                    kfnd     @0   find key\nkeyhelp                    khlp     %1   help key\nkeymark                    kmrk     %2   mark key\nkeymessage                 kmsg     %3   message key\nkeymove                    kmov     %4   move key\nkeynext                    knxt     %5   next key\nkeyopen                    kopn     %6   open key\nkeyoptions                 kopt     %7   options key\nkeyprevious                kprv     %8   previous key\nkeyprint                   kprt     %9   print key\nkeyredo                    krdo     %0   redo key\nkeyreference               kref     &1   reference key\nkeyrefresh                 krfr     &2   refresh key\nkeyreplace                 krpl     &3   replace key\nkeyrestart                 krst     &4   restart key\nkeyresume                  kres     &5   resume key\nkeysave                    ksav     &6   save key\nkeysuspend                 kspd     &7   suspend key\nkeyundo                    kund     &8   undo key\nkeysbeg                    kBEG     &9   shifted begin key\nkeyscancel                 kCAN     &0   shifted cancel key\nkeyscommand                kCMD     *1   shifted command key\nkeyscopy                   kCPY     *2   shifted copy key\nkeyscreate                 kCRT     *3   shifted create key\nkeysdc                     kDC      *4   shifted delete-character key\nkeysdl                     kDL      *5   shifted delete-line key\nkeyselect                  kslt     *6   select key\nkeysend                    kEND     *7   shifted end key\nkeyseol                    kEOL     *8   shifted clear-to-end-of-line key\nkeysexit                   kEXT     *9   shifted exit key\nkeysfind                   kFND     *0   shifted find key\nkeyshelp                   kHLP     #1   shifted help key\nkeyshome                   kHOM     #2   shifted home key\nkeysic                     kIC      #3   shifted insert-character key\nkeysleft                   kLFT     #4   shifted left-arrow key\nkeysmessage                kMSG     %a   shifted message key\nkeysmove                   kMOV     %b   shifted move key\nkeysnext                   kNXT     %c   shifted next key\nkeysoptions                kOPT     %d   shifted options key\nkeysprevious               kPRV     %e   shifted previous key\nkeysprint                  kPRT     %f   shifted print key\nkeysredo                   kRDO     %g   shifted redo key\nkeysreplace                kRPL     %h   shifted replace key\nkeysright                  kRIT     %i   shifted right-arrow key\nkeysrsume                  kRES     %j   shifted resume key\nkeyssave                   kSAV     !1   shifted save key\nkeyssuspend                kSPD     !2   shifted suspend key\nkeysundo                   kUND     !3   shifted undo key\nreqforinput               rfi      RF   send next input char (for ptys)\nkeyf11                     kf11     F1   F11 function key\nkeyf12                     kf12     F2   F12 function key\nkeyf13                     kf13     F3   F13 function key\nkeyf14                     kf14     F4   F14 function key\nkeyf15                     kf15     F5   F15 function key\nkeyf16                     kf16     F6   F16 function key\nkeyf17                     kf17     F7   F17 function key\nkeyf18                     kf18     F8   F18 function key\nkeyf19                     kf19     F9   F19 function key\nkeyf20                     kf20     FA   F20 function key\nkeyf21                     kf21     FB   F21 function key\nkeyf22                     kf22     FC   F22 function key\nkeyf23                     kf23     FD   F23 function key\nkeyf24                     kf24     FE   F24 function key\nkeyf25                     kf25     FF   F25 function key\nkeyf26                     kf26     FG   F26 function key\nkeyf27                     kf27     FH   F27 function key\nkeyf28                     kf28     FI   F28 function key\nkeyf29                     kf29     FJ   F29 function key\nkeyf30                     kf30     FK   F30 function key\nkeyf31                     kf31     FL   F31 function key\nkeyf32                     kf32     FM   F32 function key\nkeyf33                     kf33     FN   F33 function key\nkeyf34                     kf34     FO   F34 function key\nkeyf35                     kf35     FP   F35 function key\nkeyf36                     kf36     FQ   F36 function key\nkeyf37                     kf37     FR   F37 function key\nkeyf38                     kf38     FS   F38 function key\nkeyf39                     kf39     FT   F39 function key\nkeyf40                     kf40     FU   F40 function key\nkeyf41                     kf41     FV   F41 function key\nkeyf42                     kf42     FW   F42 function key\nkeyf43                     kf43     FX   F43 function key\nkeyf44                     kf44     FY   F44 function key\nkeyf45                     kf45     FZ   F45 function key\nkeyf46                     kf46     Fa   F46 function key\nkeyf47                     kf47     Fb   F47 function key\nkeyf48                     kf48     Fc   F48 function key\nkeyf49                     kf49     Fd   F49 function key\nkeyf50                     kf50     Fe   F50 function key\nkeyf51                     kf51     Ff   F51 function key\nkeyf52                     kf52     Fg   F52 function key\nkeyf53                     kf53     Fh   F53 function key\nkeyf54                     kf54     Fi   F54 function key\nkeyf55                     kf55     Fj   F55 function key\nkeyf56                     kf56     Fk   F56 function key\nkeyf57                     kf57     Fl   F57 function key\nkeyf58                     kf58     Fm   F58 function key\nkeyf59                     kf59     Fn   F59 function key\nkeyf60                     kf60     Fo   F60 function key\nkeyf61                     kf61     Fp   F61 function key\nkeyf62                     kf62     Fq   F62 function key\nkeyf63                     kf63     Fr   F63 function key\nclrbol                     el1      cb   Clear to beginning of line\nclearmargins               mgc      MC   clear right and left soft margins\nsetleftmargin             smgl     ML   set left soft margin at current column.  (ML is not\nin BSD termcap).\nsetrightmargin            smgr     MR   set right soft margin at current column\nlabelformat                fln      Lf   label format\nsetclock                   sclk     SC   set clock, #1 hrs #2 mins #3 secs\ndisplayclock               dclk     DK   display clock\nremoveclock                rmclk    RC   remove clock\ncreatewindow               cwin     CW   define a window #1 from #2,#3 to #4,#5\ngotowindow                 wingo    WG   go to window #1\nhangup                      hup      HU   hang-up phone\ndialphone                  dial     DI   dial number #1\nquickdial                  qdial    QD   dial number #1 without checking\ntone                        tone     TO   select touch tone dialing\npulse                       pulse    PU   select pulse dialing\nflashhook                  hook     fh   flash switch hook\nfixedpause                 pause    PA   pause for 2-3 seconds\nwaittone                   wait     WA   wait for dial-tone\nuser0                       u0       u0   User string #0\nuser1                       u1       u1   User string #1\nuser2                       u2       u2   User string #2\nuser3                       u3       u3   User string #3\nuser4                       u4       u4   User string #4\nuser5                       u5       u5   User string #5\nuser6                       u6       u6   User string #6\nuser7                       u7       u7   User string #7\nuser8                       u8       u8   User string #8\nuser9                       u9       u9   User string #9\norigpair                   op       op   Set default pair to its original value\norigcolors                 oc       oc   Set all color pairs to the original ones\ninitializecolor            initc    Ic   initialize color #1 to (#2,#3,#4)\ninitializepair             initp    Ip   Initialize color pair #1 to fg=(#2,#3,#4),\nbg=(#5,#6,#7)\nsetcolorpair              scp      sp   Set current color pair to #1\nsetforeground              setf     Sf   Set foreground color #1\nsetbackground              setb     Sb   Set background color #1\nchangecharpitch           cpi      ZA   Change number of characters per inch to #1\nchangelinepitch           lpi      ZB   Change number of lines per inch to #1\nchangereshorz             chr      ZC   Change horizontal resolution to #1\nchangeresvert             cvr      ZD   Change vertical resolution to #1\ndefinechar                 defc     ZE   Define a character #1, #2 dots wide, descender #3\nenterdoublewidemode       swidm    ZF   Enter double-wide mode\nenterdraftquality         sdrfq    ZG   Enter draft-quality mode\nenteritalicsmode          sitm     ZH   Enter italic mode\nenterleftwardmode         slm      ZI   Start leftward carriage motion\nentermicromode            smicm    ZJ   Start micro-motion mode\nenternearletterquality   snlq     ZK   Enter NLQ mode\nenternormalquality        snrmq    ZL   Enter normal-quality mode\nentershadowmode           sshm     ZM   Enter shadow-print mode\nentersubscriptmode        ssubm    ZN   Enter subscript mode\nentersuperscriptmode      ssupm    ZO   Enter superscript mode\nenterupwardmode           sum      ZP   Start upward carriage motion\nexitdoublewidemode        rwidm    ZQ   End double-wide mode\nexititalicsmode           ritm     ZR   End italic mode\nexitleftwardmode          rlm      ZS   End left-motion mode\nexitmicromode             rmicm    ZT   End micro-motion mode\nexitshadowmode            rshm     ZU   End shadow-print mode\nexitsubscriptmode         rsubm    ZV   End subscript mode\nexitsuperscriptmode       rsupm    ZW   End superscript mode\nexitupwardmode            rum      ZX   End reverse character motion\nmicrocolumnaddress        mhpa     ZY   Like columnaddress in micro mode\nmicrodown                  mcud1    ZZ   Like cursordown in micro mode\nmicroleft                  mcub1    Za   Like cursorleft in micro mode\nmicroright                 mcuf1    Zb   Like cursorright in micro mode\nmicrorowaddress           mvpa     Zc   Like rowaddress #1 in micro mode\nmicroup                    mcuu1    Zd   Like cursorup in micro mode\norderofpins               porder   Ze   Match software bits to print-head pins\nparmdownmicro             mcud     Zf   Like parmdowncursor in micro mode\nparmleftmicro             mcub     Zg   Like parmleftcursor in micro mode\nparmrightmicro            mcuf     Zh   Like parmrightcursor in micro mode\nparmupmicro               mcuu     Zi   Like parmupcursor in micro mode\nselectcharset             scs      Zj   Select character set, #1\nsetbottommargin           smgb     Zk   Set bottom margin at current line\nsetbottommarginparm      smgbp    Zl   Set bottom margin at line #1 or (if smgtp is not\ngiven) #2 lines from bottom\nsetleftmarginparm        smglp    Zm   Set left (right) margin at column #1\nsetrightmarginparm       smgrp    Zn   Set right margin at column #1\nsettopmargin              smgt     Zo   Set top margin at current line\nsettopmarginparm         smgtp    Zp   Set top (bottom) margin at row #1\nstartbitimage             sbim     Zq   Start printing bit image graphics\nstartcharsetdef          scsd     Zr   Start character set definition #1, with #2 charac‐\nters in the set\nstopbitimage              rbim     Zs   Stop printing bit image graphics\nstopcharsetdef           rcsd     Zt   End definition of character set #1\nsubscriptcharacters        subcs    Zu   List of subscriptable characters\nsuperscriptcharacters      supcs    Zv   List of superscriptable characters\nthesecausecr              docr     Zw   Printing any of these characters causes CR\nzeromotion                 zerom    Zx   No motion for subsequent character\n\nThe  following  string capabilities are present in the SVr4.0 term structure, but were origi‐\nnally not documented in the man page.\n\nCode"
                },
                {
                    "name": "String Capability Name      TI         TC   Description",
                    "content": "──────────────────────────────────────────────────────────────────────────────────────────────\ncharsetnames              csnm       Zy   Produce #1'th item from list of character set\nnames\nkeymouse                   kmous      Km   Mouse event has occurred\nmouseinfo                  minfo      Mi   Mouse status information\nreqmousepos               reqmp      RQ   Request mouse position\ngetmouse                   getm       Gm   Curses should get button events, parameter #1 not\ndocumented.\nsetaforeground            setaf      AF   Set foreground color to #1, using ANSI escape\nsetabackground            setab      AB   Set background color to #1, using ANSI escape\npkeyplab                   pfxl       xl   Program function key #1 to type string #2 and\nshow string #3\ndevicetype                 devt       dv   Indicate language, codeset support\ncodesetinit               csin       ci   Init sequence for multiple codesets\nset0desseq                s0ds       s0   Shift to codeset 0 (EUC set 0, ASCII)\nset1desseq                s1ds       s1   Shift to codeset 1\nset2desseq                s2ds       s2   Shift to codeset 2\nset3desseq                s3ds       s3   Shift to codeset 3\nsetlrmargin               smglr      ML   Set both left and right margins to #1, #2.  (ML\nis not in BSD termcap).\nsettbmargin               smgtb      MT   Sets both top and bottom margins to #1, #2\nbitimagerepeat            birep      Xy   Repeat bit image cell #1 #2 times\nbitimagenewline           binel      Zz   Move to next row of the bit image\nbitimagecarriagereturn   bicr       Yv   Move to beginning of same row\ncolornames                 colornm    Yw   Give name for color #1\ndefinebitimageregion     defbi      Yx   Define rectangular bit image region\nendbitimageregion        endbi      Yy   End a bit-image region\nsetcolorband              setcolor   Yz   Change to ribbon color #1\nsetpagelength             slines     YZ   Set page length to #1 lines\ndisplaypcchar             dispc      S1   Display PC character #1\nenterpccharsetmode       smpch      S2   Enter PC character display mode\nexitpccharsetmode        rmpch      S3   Exit PC character display mode\nenterscancodemode         smsc       S4   Enter PC scancode mode\nexitscancodemode          rmsc       S5   Exit PC scancode mode\npctermoptions             pctrm      S6   PC terminal options\nscancodeescape             scesc      S7   Escape for scancode emulation\naltscancodeesc            scesa      S8   Alternate escape for scancode emulation\n\nThe XSI Curses standard added these hardcopy capabilities.  They were used in  some  post-4.1\nversions  of  System  V  curses,  e.g., Solaris 2.5 and IRIX 6.x.  Except for YI, the ncurses\ntermcap names for them are invented.  According to the XSI  Curses  standard,  they  have  no\ntermcap  names.  If your compiled terminfo entries use these, they may not be binary-compati‐\nble with System V terminfo entries after SVr4.1; beware!\n\nCode"
                },
                {
                    "name": "String Capability Name     TI        TC   Description",
                    "content": "──────────────────────────────────────────────────────────────────────────────────────────────\nenterhorizontalhlmode   ehhlm     Xh   Enter horizontal highlight mode\nenterlefthlmode         elhlm     Xl   Enter left highlight mode\nenterlowhlmode          elohlm    Xo   Enter low highlight mode\nenterrighthlmode        erhlm     Xr   Enter right highlight mode\nentertophlmode          ethlm     Xt   Enter top highlight mode\nenterverticalhlmode     evhlm     Xv   Enter vertical highlight mode\nsetaattributes           sgr1      sA   Define second set of video attributes #1-#6\nsetpgleninch             slength   YI   Set page length to #1 hundredth of an inch (some\nimplementations use sL for termcap).\n"
                },
                {
                    "name": "User-Defined Capabilities",
                    "content": "The preceding section listed the predefined capabilities.  They deal with some  special  fea‐\ntures  for  terminals no longer (or possibly never) produced.  Occasionally there are special\nfeatures of newer terminals which are awkward or impossible to represent by reusing the  pre‐\ndefined capabilities.\n\nncurses addresses this limitation by allowing user-defined capabilities.  The tic and infocmp\nprograms provide the -x option for this purpose.  When -x is set, tic treats unknown capabil‐\nities as user-defined.  That is, if tic encounters a capability name which it does not recog‐\nnize,  it  infers  its type (Boolean, number or string) from the syntax and makes an extended\ntable entry for that capability.  The useextendednames(3NCURSES) function makes this infor‐\nmation conditionally available to applications.  The ncurses library provides the data  leav‐\ning most of the behavior to applications:\n\n•   User-defined capability strings whose name begins with “k” are treated as function keys.\n\n•   The types (Boolean, number, string) determined by tic can be inferred by successful calls\non tigetflag, etc.\n\n•   If  the  capability  name  happens to be two characters, the capability is also available\nthrough the termcap interface.\n\nWhile termcap is said to be extensible because it does not use a predefined set of  capabili‐\nties,  in  practice  it  has been limited to the capabilities defined by terminfo implementa‐\ntions.  As a rule, user-defined capabilities intended for use by termcap applications  should\nbe limited to Booleans and numbers to avoid running past the 1023 byte limit assumed by term‐\ncap  implementations and their applications.  In particular, providing extended sets of func‐\ntion keys (past the 60 numbered keys and the handful of special named keys) is best done  us‐\ning the longer names available using terminfo.\n\nThe  ncurses  library  uses  a  few  of  these  user-defined  capabilities,  as  described in\nusercaps(5).  Other user-defined capabilities (including function keys) are described in the\nterminal database, in the section on NCURSES USER-DEFINABLE CAPABILITIES\n"
                },
                {
                    "name": "A Sample Entry",
                    "content": "The following entry, describing an ANSI-standard terminal, is representative of what  a  ter‐\nminfo entry for a modern terminal typically looks like.\n\nansi|ansi/pc-term compatible with color,\nam, mc5i, mir, msgr,\ncolors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,\nacsc=+\\020\\,\\021-\\030.^Y0\\333`\\004a\\261f\\370g\\361h\\260\nj\\331k\\277l\\332m\\300n\\305o~p\\304q\\304r\\304st\\303\nu\\264v\\301w\\302x\\263y\\363z\\362{\\343|\\330}\\234~\\376,\nbel=^G, blink=\\E[5m, bold=\\E[1m, cbt=\\E[Z, clear=\\E[H\\E[J,\ncr=^M, cub=\\E[%p1%dD, cub1=\\E[D, cud=\\E[%p1%dB, cud1=\\E[B,\ncuf=\\E[%p1%dC, cuf1=\\E[C, cup=\\E[%i%p1%d;%p2%dH,\ncuu=\\E[%p1%dA, cuu1=\\E[A, dch=\\E[%p1%dP, dch1=\\E[P,\ndl=\\E[%p1%dM, dl1=\\E[M, ech=\\E[%p1%dX, ed=\\E[J, el=\\E[K,\nel1=\\E[1K, home=\\E[H, hpa=\\E[%i%p1%dG, ht=\\E[I, hts=\\EH,\nich=\\E[%p1%d@, il=\\E[%p1%dL, il1=\\E[L, ind=^J,\nindn=\\E[%p1%dS, invis=\\E[8m, kbs=^H, kcbt=\\E[Z, kcub1=\\E[D,\nkcud1=\\E[B, kcuf1=\\E[C, kcuu1=\\E[A, khome=\\E[H, kich1=\\E[L,\nmc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S, op=\\E[39;49m,\nrep=%p1%c\\E[%p2%{1}%-%db, rev=\\E[7m, rin=\\E[%p1%dT,\nrmacs=\\E[10m, rmpch=\\E[10m, rmso=\\E[m, rmul=\\E[m,\ns0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B, s3ds=\\E+B,\nsetab=\\E[4%p1%dm, setaf=\\E[3%p1%dm,\nsgr=\\E[0;10%?%p1%t;7%;\n%?%p2%t;4%;\n%?%p3%t;7%;\n%?%p4%t;5%;\n%?%p6%t;1%;\n%?%p7%t;8%;\n%?%p9%t;11%;m,\nsgr0=\\E[0;10m, smacs=\\E[11m, smpch=\\E[11m, smso=\\E[7m,\nsmul=\\E[4m, tbc=\\E[3g, u6=\\E[%i%d;%dR, u7=\\E[6n,\nu8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%i%p1%dd,\n\nEntries may continue onto multiple lines by placing white space at the beginning of each line\nexcept  the  first.   Comments  may be included on lines beginning with “#”.  Capabilities in\nterminfo are of three types:\n\n•   Boolean capabilities which indicate that the terminal has some particular feature,\n\n•   numeric capabilities giving the size of the terminal or the size  of  particular  delays,\nand\n\n•   string capabilities, which give a sequence which can be used to perform particular termi‐\nnal operations.\n"
                },
                {
                    "name": "Types of Capabilities",
                    "content": "All  capabilities have names.  For instance, the fact that ANSI-standard terminals have auto‐\nmatic margins (i.e., an automatic return and line-feed when the end of a line is reached)  is\nindicated by the capability am.  Hence the description of ansi includes am.  Numeric capabil‐\nities  are  followed  by the character “#” and then a positive value.  Thus cols, which indi‐\ncates the number of columns the terminal has, gives the value “80” for ansi.  Values for  nu‐\nmeric  capabilities  may be specified in decimal, octal, or hexadecimal, using the C program‐\nming language conventions (e.g., 255, 0377 and 0xff or 0xFF).\n\nFinally, string valued capabilities, such as el (clear to end of line sequence) are given  by\nthe two-character code, an “=”, and then a string ending at the next following “,”.\n\nA number of escape sequences are provided in the string valued capabilities for easy encoding\nof characters there:\n\n•   Both \\E and \\e map to an ESCAPE character,\n\n•   ^x maps to a control-x for any appropriate x, and\n\n•   the sequences\n\n\\n, \\l, \\r, \\t, \\b, \\f, and \\s\n\nproduce\n\nnewline, line-feed, return, tab, backspace, form-feed, and space,\n\nrespectively.\n\nX/Open  Curses  does not say what “appropriate x” might be.  In practice, that is a printable\nASCII graphic character.  The special case “^?” is interpreted as DEL (127).   In  all  other\ncases,  the character value is AND'd with 0x1f, mapping to ASCII control codes in the range 0\nthrough 31.\n\nOther escapes include\n\n•   \\^ for ^,\n\n•   \\\\ for \\,\n\n•   \\, for comma,\n\n•   \\: for :,\n\n•   and \\0 for null.\n\n\\0 will produce \\200, which does not terminate a string but behaves as a  null  character\non most terminals, providing CS7 is specified.  See stty(1).\n\nThe  reason  for  this quirk is to maintain binary compatibility of the compiled terminfo\nfiles with other implementations, e.g., the SVr4 systems, which document this.   Compiled\nterminfo  files  use  null-terminated strings, with no lengths.  Modifying this would re‐\nquire a new binary format, which would not work with other implementations.\n\nFinally, characters may be given as three octal digits after a \\.\n\nA delay in milliseconds may appear anywhere in a string capability, enclosed in $<..>  brack‐\nets, as in el=\\EK$<5>, and padding characters are supplied by tputs(3NCURSES) to provide this\ndelay.\n\n•   The  delay  must  be a number with at most one decimal place of precision; it may be fol‐\nlowed by suffixes “*” or “/” or both.\n\n•   A “*” indicates that the padding required is proportional to the number of lines affected\nby the operation, and the amount given is the per-affected-unit  padding  required.   (In\nthe case of insert character, the factor is still the number of lines affected.)\n\nNormally,  padding  is advisory if the device has the xon capability; it is used for cost\ncomputation but does not trigger delays.\n\n•   A “/” suffix indicates that the padding is mandatory and forces a delay of the given num‐\nber of milliseconds even on devices for which xon is present to indicate flow control.\n\nSometimes individual capabilities must be commented out.  To do this, put a period before the\ncapability name.  For example, see the second ind in the example above.\n"
                },
                {
                    "name": "Fetching Compiled Descriptions",
                    "content": "Terminal descriptions in ncurses are stored in terminal databases.   These  databases,  which\nare  found by their pathname, may be configured either as directory trees or hashed databases\n(see term(5)),\n\nThe library uses a compiled-in list of pathnames, which  can  be  overridden  by  environment\nvariables.  Before starting to search, ncurses checks the search list, eliminating duplicates\nand  pathnames  where no terminal database is found.  The ncurses library reads the first de‐\nscription which passes its consistency checks.\n\n•   The environment variable TERMINFO is checked first, for a  terminal  database  containing\nthe terminal description.\n\n•   Next, ncurses looks in $HOME/.terminfo for a compiled description.\n\nThis is an optional feature which may be omitted entirely from the library, or limited to\nprevent accidental use by privileged applications.\n\n•   Next,  if  the environment variable TERMINFODIRS is set, ncurses interprets the contents\nof that variable as a list of colon-separated  pathnames  of  terminal  databases  to  be\nsearched.\n\nAn  empty  pathname (i.e., if the variable begins or ends with a colon, or contains adja‐\ncent colons) is interpreted as the system location /etc/terminfo.\n\n•   Finally, ncurses searches these compiled-in locations:\n\n•   a list of directories (/etc/terminfo:/lib/terminfo:/usr/share/terminfo), and\n\n•   the system terminfo directory, /etc/terminfo\n\nThe TERMINFO variable can contain a terminal description instead of the pathname of a  termi‐\nnal  database.   If  this variable begins with “hex:” or “b64:” then ncurses reads a terminal\ndescription from hexadecimal- or base64-encoded data, and if  that  description  matches  the\nname sought, will use that.  This encoded data can be set using the “-Q” option of tic or in‐\nfocmp.\n\nThe  preceding addresses the usual configuration of ncurses, which uses terminal descriptions\nprepared in terminfo format.  While termcap is less expressive, ncurses can also  be  config‐\nured to read termcap descriptions.  In that configuration, it checks the TERMCAP and TERMPATH\nvariables (for content and search path, respectively) after the system terminal database.\n"
                },
                {
                    "name": "Preparing Descriptions",
                    "content": "We now outline how to prepare descriptions of terminals.  The most effective way to prepare a\nterminal description is by imitating the description of a similar terminal in terminfo and to\nbuild  up  a  description gradually, using partial descriptions with vi or some other screen-\noriented program to check that they are correct.  Be aware that a very unusual  terminal  may\nexpose deficiencies in the ability of the terminfo file to describe it or bugs in the screen-\nhandling code of the test program.\n\nTo get the padding for insert line right (if the terminal manufacturer did not document it) a\nsevere  test  is  to edit a large file at 9600 baud, delete 16 or so lines from the middle of\nthe screen, then hit the “u” key several times quickly.  If  the  terminal  messes  up,  more\npadding is usually needed.  A similar test can be used for insert character.\n"
                },
                {
                    "name": "Basic Capabilities",
                    "content": "The  number of columns on each line for the terminal is given by the cols numeric capability.\nIf the terminal is a CRT, then the number of lines on the screen is given by the lines  capa‐\nbility.   If  the terminal wraps around to the beginning of the next line when it reaches the\nright margin, then it should have the am capability.  If the terminal can clear  its  screen,\nleaving  the  cursor in the home position, then this is given by the clear string capability.\nIf the terminal overstrikes (rather than clearing a position when a character is struck over)\nthen it should have the os capability.  If the terminal is a printing terminal, with no  soft\ncopy unit, give it both hc and os.  (os applies to storage scope terminals, such as TEKTRONIX\n4010  series, as well as hard copy and APL terminals.)  If there is a code to move the cursor\nto the left edge of the current row, give this as cr.  (Normally this will  be  carriage  re‐\nturn,  control/M.)   If  there  is a code to produce an audible signal (bell, beep, etc) give\nthis as bel.\n\nIf there is a code to move the cursor one position to the left (such as backspace) that capa‐\nbility should be given as cub1.  Similarly, codes to move to the right, up, and  down  should\nbe  given as cuf1, cuu1, and cud1.  These local cursor motions should not alter the text they\npass over, for example, you would not normally use “cuf1= ” because the space would erase the\ncharacter moved over.\n\nA very important point here is that the local cursor motions encoded in  terminfo  are  unde‐\nfined  at  the  left and top edges of a CRT terminal.  Programs should never attempt to back‐\nspace around the left edge, unless bw is given, and never attempt to go up  locally  off  the\ntop.   In  order to scroll text up, a program will go to the bottom left corner of the screen\nand send the ind (index) string.\n\nTo scroll text down, a program goes to the top left corner of the screen  and  sends  the  ri\n(reverse  index)  string.   The strings ind and ri are undefined when not on their respective\ncorners of the screen.\n\nParameterized versions of the scrolling sequences are indn and rin which have the same seman‐\ntics as ind and ri except that they take one parameter, and scroll that many lines.  They are\nalso undefined except at the appropriate edge of the screen.\n\nThe am capability tells whether the cursor sticks at the right edge of the screen  when  text\nis  output, but this does not necessarily apply to a cuf1 from the last column.  The only lo‐\ncal motion which is defined from the left edge is if bw is given, then a cub1 from  the  left\nedge  will move to the right edge of the previous row.  If bw is not given, the effect is un‐\ndefined.  This is useful for drawing a box around the edge of the screen,  for  example.   If\nthe  terminal has switch selectable automatic margins, the terminfo file usually assumes that\nthis is on; i.e., am.  If the terminal has a command which moves to the first column  of  the\nnext  line,  that  command  can be given as nel (newline).  It does not matter if the command\nclears the remainder of the current line, so if the terminal has no cr and lf it may still be\npossible to craft a working nel out of one or both of them.\n\nThese capabilities suffice to describe hard-copy and “glass-tty” terminals.  Thus  the  model\n33 teletype is described as\n\n33|tty33|tty|model 33 teletype,\nbel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\n\nwhile the Lear Siegler ADM-3 is described as\n\nadm3|3|lsi adm3,\nam, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,\nind=^J, lines#24,\n"
                },
                {
                    "name": "Parameterized Strings",
                    "content": "Cursor  addressing  and other strings requiring parameters in the terminal are described by a\nparameterized string capability, with printf-like escapes such as %x in it.  For example,  to\naddress  the cursor, the cup capability is given, using two parameters: the row and column to\naddress to.  (Rows and columns are numbered from zero and refer to the physical screen  visi‐\nble  to  the user, not to any unseen memory.)  If the terminal has memory relative cursor ad‐\ndressing, that can be indicated by mrcup.\n\nThe parameter mechanism uses a stack and special % codes to manipulate it.  Typically  a  se‐\nquence  will  push  one  of  the  parameters onto the stack and then print it in some format.\nPrint (e.g., “%d”) is a special case.  Other operations, including  “%t”  pop  their  operand\nfrom  the  stack.  It is noted that more complex operations are often necessary, e.g., in the\nsgr string.\n\nThe % encodings have the following meanings:\n\n%%   outputs “%”\n\n%[[:]flags][width[.precision]][doxXs]\nas in printf(3), flags are [-+#] and space.  Use a “:” to allow the next character to be\na “-” flag, avoiding interpreting “%-” as an operator.\n\n%c   print pop() like %c in printf\n\n%s   print pop() like %s in printf\n\n%p[1-9]\npush i'th parameter\n\n%P[a-z]\nset dynamic variable [a-z] to pop()\n\n%g[a-z]\nget dynamic variable [a-z] and push it\n\n%P[A-Z]\nset static variable [a-z] to pop()\n\n%g[A-Z]\nget static variable [a-z] and push it\n\nThe terms “static” and “dynamic” are misleading.  Historically,  these  are  simply  two\ndifferent   sets   of   variables,   whose   values  are  not  reset  between  calls  to\ntparm(3NCURSES).  However, that fact is not documented in other implementations.   Rely‐\ning on it will adversely impact portability to other implementations:\n\n•   SVr2 curses supported dynamic variables.  Those are set only by a %P operator.  A %g\nfor  a  given  variable without first setting it with %P will give unpredictable re‐\nsults, because dynamic variables are an uninitialized local array on  the  stack  in\nthe tparm function.\n\n•   SVr3.2 curses supported static variables.  Those are an array in the TERMINAL struc‐\nture  (declared in term.h), and are zeroed automatically when the setupterm function\nallocates the data.\n\n•   SVr4 curses made no further improvements to the dynamic/static variable feature.\n\n•   Solaris XPG4 curses does not distinguish between dynamic and static variables.  They\nare the same.  Like SVr4 curses, XPG4 curses does not initialize these explicitly.\n\n•   Before version 6.3, ncurses stores both dynamic and static variables  in  persistent\nstorage, initialized to zeros.\n\n•   Beginning  with version 6.3, ncurses stores static and dynamic variables in the same\nmanner as SVr4.\n\n•   Unlike other implementations, ncurses zeros dynamic variables before  the  first\n%g or %P operator.\n\n•   Like  SVr2, the scope of dynamic variables in ncurses is within the current call\nto tparm.  Use static variables if persistent storage is needed.\n\n%'c' char constant c\n\n%{nn}\ninteger constant nn\n\n%l   push strlen(pop)\n\n%+, %-, %*, %/, %m\narithmetic (%m is mod): push(pop() op pop())\n\n%&, %|, %^\nbit operations (AND, OR and exclusive-OR): push(pop() op pop())\n\n%=, %>, %<\nlogical operations: push(pop() op pop())\n\n%A, %O\nlogical AND and OR operations (for conditionals)\n\n%!, %~\nunary operations (logical and bit complement): push(op pop())\n\n%i   add 1 to first two parameters (for ANSI terminals)\n\n%? expr %t thenpart %e elsepart %;\nThis forms an if-then-else.  The %e elsepart is optional.   Usually  the  %?  expr  part\npushes  a  value onto the stack, and %t pops it from the stack, testing if it is nonzero\n(true).  If it is zero (false), control passes to the %e (else) part.\n\nIt is possible to form else-if's a la Algol 68:\n%? c1 %t b1 %e c2 %t b2 %e c3 %t b3 %e c4 %t b4 %e %;\n\nwhere ci are conditions, bi are bodies.\n\nUse the -f option of tic or infocmp  to  see  the  structure  of  if-then-else's.   Some\nstrings,  e.g.,  sgr  can  be  very complicated when written on one line.  The -f option\nsplits the string into lines with the parts indented.\n\nBinary operations are in postfix form with the operands in the usual order.  That is, to  get\nx-5 one would use “%gx%{5}%-”.  %P and %g variables are persistent across escape-string eval‐\nuations.\n\nConsider the HP2645, which, to get to row 3 and column 12, needs to be sent \\E&a12c03Y padded\nfor 6 milliseconds.  The order of the rows and columns is inverted here, and the row and col‐\numn are printed as two digits.  The corresponding terminal description is expressed thus:\ncup=\\E&a%p2%dc%p1%dY$<6>,\n\nThe Microterm ACT-IV needs the current row and column sent preceded by a ^T, with the row and\ncolumn simply encoded in binary,\ncup=^T%p1%c%p2%c\n\nTerminals which use “%c” need to be able to backspace the cursor (cub1), and to move the cur‐\nsor  up  one  line  on the screen (cuu1).  This is necessary because it is not always safe to\ntransmit \\n ^D and \\r, as the system may change or discard them.  (The library routines deal‐\ning with terminfo set tty modes so that tabs are never expanded, so \\t is safe to send.  This\nturns out to be essential for the Ann Arbor 4080.)\n\nA final example is the LSI ADM-3a, which uses row and column offset  by  a  blank  character,\nthus\ncup=\\E=%p1%' '%+%c%p2%' '%+%c\n\nAfter  sending  “\\E=”,  this  pushes  the first parameter, pushes the ASCII value for a space\n(32), adds them (pushing the sum on the stack in place of the two previous values)  and  out‐\nputs  that  value as a character.  Then the same is done for the second parameter.  More com‐\nplex arithmetic is possible using the stack.\n"
                },
                {
                    "name": "Cursor Motions",
                    "content": "If the terminal has a fast way to home the cursor (to very upper left corner of screen)  then\nthis  can be given as home; similarly a fast way of getting to the lower left-hand corner can\nbe given as ll; this may involve going up with cuu1 from the home  position,  but  a  program\nshould  never do this itself (unless ll does) because it can make no assumption about the ef‐\nfect of moving up from the home position.  Note that the home position is  the  same  as  ad‐\ndressing  to  (0,0): to the top left corner of the screen, not of memory.  (Thus, the \\EH se‐\nquence on HP terminals cannot be used for home.)\n\nIf the terminal has row or column absolute cursor addressing, these can be  given  as  single\nparameter  capabilities  hpa  (horizontal  position  absolute) and vpa (vertical position ab‐\nsolute).  Sometimes these are shorter than the more general two parameter sequence  (as  with\nthe  hp2645)  and can be used in preference to cup.  If there are parameterized local motions\n(e.g., move n spaces to the right) these can be given as cud, cub, cuf, and cuu with a single\nparameter indicating how many spaces to move.  These are primarily  useful  if  the  terminal\ndoes not have cup, such as the TEKTRONIX 4025.\n\nIf the terminal needs to be in a special mode when running a program that uses these capabil‐\nities,  the  codes to enter and exit this mode can be given as smcup and rmcup.  This arises,\nfor example, from terminals like the Concept with more than one page of memory.  If the  ter‐\nminal has only memory relative cursor addressing and not screen relative cursor addressing, a\none  screen-sized  window must be fixed into the terminal for cursor addressing to work prop‐\nerly.  This is also used for the TEKTRONIX 4025, where smcup sets the command character to be\nthe one used by terminfo.  If the smcup sequence will not restore the screen after  an  rmcup\nsequence is output (to the state prior to outputting rmcup), specify nrrmc.\n"
                },
                {
                    "name": "Margins",
                    "content": "SVr4  (and X/Open Curses) list several string capabilities for setting margins.  Two were in‐\ntended for use with terminals, and another six were intended for use with printers.\n\n•   The two terminal capabilities assume that the terminal may have the capability of setting\nthe left and/or right margin at the current cursor column position.\n\n•   The printer capabilities assume that the printer may have two types of capability:\n\n•   the ability to set a top and/or bottom margin using the current line position, and\n\n•   parameterized capabilities for setting the top, bottom, left, right margins given the\nnumber of rows or columns.\n\nIn practice, the categorization into “terminal” and “printer” is not suitable:\n\n•   The AT&T SVr4 terminal database uses smgl four times, for AT&T hardware.\n\nThree of the four are printers.  They lack the ability to set left/right margins by spec‐\nifying the column.\n\n•   Other (non-AT&T) terminals may support margins but using different assumptions from AT&T.\n\nFor instance, the DEC VT420 supports left/right margins, but only using a column  parame‐\nter.   As  an  added complication, the VT420 uses two settings to fully enable left/right\nmargins (left/right margin mode, and origin mode).  The former enables the margins, which\ncauses printed text to wrap within margins, but the latter is needed to  prevent  cursor-\naddressing outside those margins.\n\n•   Both  DEC  VT420 left/right margins are set with a single control sequence.  If either is\nomitted, the corresponding margin is set to the left or right edge of the display (rather\nthan leaving the margin unmodified).\n\nThese are the margin-related capabilities:\n\nName    Description\n───────────────────────────────────────────────────\nsmgl    Set left margin at current column\nsmgr    Set right margin at current column\nsmgb    Set bottom margin at current line\nsmgt    Set top margin at current line\nsmgbp   Set bottom margin at line N\nsmglp   Set left margin at column N\nsmgrp   Set right margin at column N\nsmgtp   Set top margin at line N\nsmglr   Set both left and right margins to L and R\nsmgtb   Set both top and bottom margins to T and B\n\nWhen writing an application that uses these string capabilities, the pairs  should  be  first\nchecked to see if each capability in the pair is set or only one is set:\n\n•   If  both  smglp and smgrp are set, each is used with a single argument, N, that gives the\ncolumn number of the left and right margin, respectively.\n\n•   If both smgtp and smgbp are set, each is used to set the top and bottom  margin,  respec‐\ntively:\n\n•   smgtp is used with a single argument, N, the line number of the top margin.\n\n•   smgbp  is  used  with two arguments, N and M, that give the line number of the bottom\nmargin, the first counting from the top of the page and the second counting from  the\nbottom.   This accommodates the two styles of specifying the bottom margin in differ‐\nent manufacturers' printers.\n\nWhen designing a terminfo entry for a printer that has a settable bottom margin, only the\nfirst or second argument should be used, depending on the printer.   When  developing  an\napplication that uses smgbp to set the bottom margin, both arguments must be given.\n\nConversely, when only one capability in the pair is set:\n\n•   If  only  one  of  smglp and smgrp is set, then it is used with two arguments, the column\nnumber of the left and right margins, in that order.\n\n•   Likewise, if only one of smgtp and smgbp is set, then it is used with two arguments  that\ngive the top and bottom margins, in that order, counting from the top of the page.\n\nWhen  designing  a terminfo entry for a printer that requires setting both left and right\nor top and bottom margins simultaneously, only one capability in the pairs smglp and  sm‐\ngrp or smgtp and smgbp should be defined, leaving the other unset.\n\nExcept  for  very  old terminal descriptions, e.g., those developed for SVr4, the scheme just\ndescribed should be considered obsolete.  An improved set of capabilities was added  late  in\nthe  SVr4  releases  (smglr  and  smgtb), which explicitly use two parameters for setting the\nleft/right or top/bottom margins.\n\nWhen setting margins, the line- and column-values are zero-based.\n\nThe mgc string capability should be defined.  Applications such as tabs(1) rely upon this  to\nreset all margins.\n"
                },
                {
                    "name": "Area Clears",
                    "content": "If  the terminal can clear from the current position to the end of the line, leaving the cur‐\nsor where it is, this should be given as el.  If the terminal can clear from the beginning of\nthe line to the current position inclusive, leaving the cursor where it is,  this  should  be\ngiven as el1.  If the terminal can clear from the current position to the end of the display,\nthen this should be given as ed.  Ed is only defined from the first column of a line.  (Thus,\nit  can  be  simulated  by  a  request to delete a large number of lines, if a true ed is not\navailable.)\n"
                },
                {
                    "name": "Insert/Delete Line and Vertical Motions",
                    "content": "If the terminal can open a new blank line before the line where the cursor is, this should be\ngiven as il1; this is done only from the first position of a line.  The cursor must then  ap‐\npear  on  the  newly blank line.  If the terminal can delete the line which the cursor is on,\nthen this should be given as dl1; this is done only from the first position on the line to be\ndeleted.  Versions of il1 and dl1 which take a single parameter and  insert  or  delete  that\nmany lines can be given as il and dl.\n\nIf  the terminal has a settable scrolling region (like the vt100) the command to set this can\nbe described with the csr capability, which takes two parameters: the top and bottom lines of\nthe scrolling region.  The cursor position is, alas, undefined after using this command.\n\nIt is possible to get the effect of insert or delete line using csr on a properly chosen  re‐\ngion;  the  sc and rc (save and restore cursor) commands may be useful for ensuring that your\nsynthesized insert/delete string does not move the cursor.  (Note that the  ncurses(3NCURSES)\nlibrary  does this synthesis automatically, so you need not compose insert/delete strings for\nan entry with csr).\n\nYet another way to construct insert and delete might be to use a combination  of  index  with\nthe  memory-lock  feature  found  on some terminals (like the HP-700/90 series, which however\nalso has insert/delete).\n\nInserting lines at the top or bottom of the screen can also be done using ri or ind  on  many\nterminals without a true insert/delete line, and is often faster even on terminals with those\nfeatures.\n\nThe  Boolean  nondestscrollregion  should be set if each scrolling window is effectively a\nview port on a screen-sized canvas.  To test for this capability, create a  scrolling  region\nin  the  middle of the screen, write something to the bottom line, move the cursor to the top\nof the region, and do ri followed by dl1 or ind.  If the data scrolled off the bottom of  the\nregion  by the ri re-appears, then scrolling is non-destructive.  System V and XSI Curses ex‐\npect that ind, ri, indn, and rin will simulate  destructive  scrolling;  their  documentation\ncautions  you not to define csr unless this is true.  This curses implementation is more lib‐\neral and will do explicit erases after scrolling if ndsrc is defined.\n\nIf the terminal has the ability to define a window as part of memory, which all commands  af‐\nfect,  it  should  be  given  as  the parameterized string wind.  The four parameters are the\nstarting and ending lines in memory and the starting and ending columns in  memory,  in  that\norder.\n\nIf  the  terminal can retain display memory above, then the da capability should be given; if\ndisplay memory can be retained below, then db should be given.  These indicate that  deleting\na  line  or  scrolling may bring non-blank lines up from below or that scrolling back with ri\nmay bring down non-blank lines.\n"
                },
                {
                    "name": "Insert/Delete Character",
                    "content": "There are two basic kinds of intelligent terminals with respect  to  insert/delete  character\nwhich  can  be  described using terminfo.  The most common insert/delete character operations\naffect only the characters on the current line and shift characters off the end of  the  line\nrigidly.   Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make a distinc‐\ntion between typed and untyped blanks on the screen, shifting upon an insert or  delete  only\nto  an  untyped  blank  on  the screen which is either eliminated, or expanded to two untyped\nblanks.\n\nYou can determine the kind of terminal you have by clearing the screen and then  typing  text\nseparated  by  cursor motions.  Type “abc    def” using local cursor motions (not spaces) be‐\ntween the “abc” and the “def”.  Then position the cursor before the “abc” and put the  termi‐\nnal  in  insert  mode.  If typing characters causes the rest of the line to shift rigidly and\ncharacters to fall off the end, then your terminal does not distinguish  between  blanks  and\nuntyped positions.  If the “abc” shifts over to the “def” which then move together around the\nend  of  the current line and onto the next as you insert, you have the second type of termi‐\nnal, and should give the capability in, which stands for “insert null”.\n\nWhile these are two logically separate attributes (one line versus  multi-line  insert  mode,\nand  special  treatment of untyped spaces) we have seen no terminals whose insert mode cannot\nbe described with the single attribute.\n\nTerminfo can describe both terminals which have an insert mode, and terminals  which  send  a\nsimple  sequence  to open a blank position on the current line.  Give as smir the sequence to\nget into insert mode.  Give as rmir the sequence to leave insert mode.  Now give as ich1  any\nsequence  needed to be sent just before sending the character to be inserted.  Most terminals\nwith a true insert mode will not give ich1; terminals which send a sequence to open a  screen\nposition should give it here.\n\nIf  your  terminal  has  both,  insert  mode is usually preferable to ich1.  Technically, you\nshould not give both unless the terminal actually requires both to be  used  in  combination.\nAccordingly,  some  non-curses  applications get confused if both are present; the symptom is\ndoubled characters in an update using insert.  This requirement is now  rare;  most  ich  se‐\nquences  do  not require previous smir, and most smir insert modes do not require ich1 before\neach character.  Therefore, the new curses actually assumes this is the case and uses  either\nrmir/smir  or  ich/ich1  as  appropriate (but not both).  If you have to write an entry to be\nused under new curses for a terminal old enough to need both, include the rmir/smir sequences\nin ich1.\n\nIf post insert padding is needed, give this as a number of milliseconds in ip (a  string  op‐\ntion).   Any  other  sequence which may need to be sent after an insert of a single character\nmay also be given in ip.  If your terminal needs both to be placed into an “insert mode”  and\na special code to precede each inserted character, then both smir/rmir and ich1 can be given,\nand both will be used.  The ich capability, with one parameter, n, will repeat the effects of\nich1 n times.\n\nIf  padding  is  necessary  between characters typed while not in insert mode, give this as a\nnumber of milliseconds padding in rmp.\n\nIt is occasionally necessary to move around while in insert mode to delete characters on  the\nsame  line  (e.g.,  if there is a tab after the insertion position).  If your terminal allows\nmotion while in insert mode you can give the capability mir to speed  up  inserting  in  this\ncase.   Omitting  mir  will affect only speed.  Some terminals (notably Datamedia's) must not\nhave mir because of the way their insert mode works.\n\nFinally, you can specify dch1 to delete a single character, dch with  one  parameter,  n,  to\ndelete  n  characters,  and delete mode by giving smdc and rmdc to enter and exit delete mode\n(any mode the terminal needs to be placed in for dch1 to work).\n\nA command to erase n characters (equivalent to outputting n blanks without moving the cursor)\ncan be given as ech with one parameter.\n"
                },
                {
                    "name": "Highlighting, Underlining, and Visible Bells",
                    "content": "If your terminal has one or more kinds of display attributes, these can be represented  in  a\nnumber  of different ways.  You should choose one display form as standout mode, representing\na good, high contrast, easy-on-the-eyes, format for highlighting error messages and other at‐\ntention getters.  (If you have a choice, reverse video plus half-bright is good,  or  reverse\nvideo  alone.)  The sequences to enter and exit standout mode are given as smso and rmso, re‐\nspectively.  If the code to change into or out of standout mode leaves one or even two  blank\nspaces  on  the  screen, as the TVI 912 and Teleray 1061 do, then xmc should be given to tell\nhow many spaces are left.\n\nCodes to begin underlining and end underlining can be given as smul  and  rmul  respectively.\nIf  the  terminal has a code to underline the current character and move the cursor one space\nto the right, such as the Microterm Mime, this can be given as uc.\n\nOther capabilities to enter various highlighting modes include blink (blinking) bold (bold or\nextra bright) dim (dim or half-bright) invis (blanking or invisible  text)  prot  (protected)\nrev  (reverse video) sgr0 (turn off all attribute modes) smacs (enter alternate character set\nmode) and rmacs (exit alternate character set mode).  Turning on any of  these  modes  singly\nmay or may not turn off other modes.\n\nIf  there  is  a sequence to set arbitrary combinations of modes, this should be given as sgr\n(set attributes), taking 9 parameters.  Each parameter is either zero (0) or nonzero, as  the\ncorresponding  attribute  is on or off.  The 9 parameters are, in order: standout, underline,\nreverse, blink, dim, bold, blank, protect, alternate character set.  Not all  modes  need  be\nsupported by sgr, only those for which corresponding separate attribute commands exist.\n\nFor example, the DEC vt220 supports most of the modes:\n\ntparm Parameter   Attribute    Escape Sequence\n────────────────────────────────────────────────\nnone              none         \\E[0m\np1                standout     \\E[0;1;7m\np2                underline    \\E[0;4m\np3                reverse      \\E[0;7m\np4                blink        \\E[0;5m\np5                dim          not available\np6                bold         \\E[0;1m\np7                invis        \\E[0;8m\np8                protect      not used\np9                altcharset   ^O (off) ^N (on)\n\nWe  begin each escape sequence by turning off any existing modes, since there is no quick way\nto determine whether they are active.  Standout is set up to be the  combination  of  reverse\nand  bold.   The vt220 terminal has a protect mode, though it is not commonly used in sgr be‐\ncause it protects characters on the screen from the host's  erasures.   The  altcharset  mode\nalso  is  different  in that it is either ^O or ^N, depending on whether it is off or on.  If\nall modes are turned on, the resulting sequence is \\E[0;1;4;5;7;8m^N.\n\nSome sequences are common to different modes.  For example, ;7 is output when either p1 or p3\nis true, that is, if either standout or reverse modes are turned on.\n\nWriting out the above sequences, along with their dependencies yields\n\nSequence   When to Output      terminfo Translation\n────────────────────────────────────────────────────\n\\E[0       always              \\E[0\n;1         if p1 or p6         %?%p1%p6%|%t;1%;\n;4         if p2               %?%p2%|%t;4%;\n;5         if p4               %?%p4%|%t;5%;\n;7         if p1 or p3         %?%p1%p3%|%t;7%;\n;8         if p7               %?%p7%|%t;8%;\nm          always              m\n^N or ^O   if p9 ^N, else ^O   %?%p9%t^N%e^O%;\n\nPutting this all together into the sgr sequence gives:\n\nsgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p4%t;5%;\n%?%p1%p3%|%t;7%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;,\n\nRemember that if you specify sgr, you must also specify  sgr0.   Also,  some  implementations\nrely  on sgr being given if sgr0 is, Not all terminfo entries necessarily have an sgr string,\nhowever.  Many terminfo entries are derived from termcap entries which have  no  sgr  string.\nThe  only  drawback  to  adding an sgr string is that termcap also assumes that sgr0 does not\nexit alternate character set mode.\n\nTerminals with the “magic cookie” glitch (xmc) deposit special “cookies”  when  they  receive\nmode-setting  sequences, which affect the display algorithm rather than having extra bits for\neach character.  Some terminals, such as the HP 2621, automatically leave standout mode  when\nthey move to a new line or the cursor is addressed.  Programs using standout mode should exit\nstandout  mode before moving the cursor or sending a newline, unless the msgr capability, as‐\nserting that it is safe to move in standout mode, is present.\n\nIf the terminal has a way of flashing the screen to indicate an error  quietly  (a  bell  re‐\nplacement) then this can be given as flash; it must not move the cursor.\n\nIf the cursor needs to be made more visible than normal when it is not on the bottom line (to\nmake,  for  example, a non-blinking underline into an easier to find block or blinking under‐\nline) give this sequence as cvvis.  If there is a way to make the cursor  completely  invisi‐\nble,  give  that  as civis.  The capability cnorm should be given which undoes the effects of\nboth of these modes.\n\nIf your terminal correctly generates underlined characters (with  no  special  codes  needed)\neven  though  it does not overstrike, then you should give the capability ul.  If a character\noverstriking another leaves both characters on the screen, specify  the  capability  os.   If\noverstrikes are erasable with a blank, then this should be indicated by giving eo.\n"
                },
                {
                    "name": "Keypad and Function Keys",
                    "content": "If the terminal has a keypad that transmits codes when the keys are pressed, this information\ncan  be  given.  Note that it is not possible to handle terminals where the keypad only works\nin local (this applies, for example, to the unshifted HP 2621 keys).  If the  keypad  can  be\nset  to transmit or not transmit, give these codes as smkx and rmkx.  Otherwise the keypad is\nassumed to always transmit.\n\nThe codes sent by the left arrow, right arrow, up arrow, down arrow, and  home  keys  can  be\ngiven as kcub1, kcuf1, kcuu1, kcud1, and khome respectively.  If there are function keys such\nas  f0, f1, ..., f10, the codes they send can be given as kf0, kf1, ..., kf10.  If these keys\nhave labels other than the default f0 through f10, the labels can be given as lf0, lf1,  ...,\nlf10.\n\nThe codes transmitted by certain other special keys can be given:\n\n•   kll (home down),\n\n•   kbs (backspace),\n\n•   ktbc (clear all tabs),\n\n•   kctab (clear the tab stop in this column),\n\n•   kclr (clear screen or erase key),\n\n•   kdch1 (delete character),\n\n•   kdl1 (delete line),\n\n•   krmir (exit insert mode),\n\n•   kel (clear to end of line),\n\n•   ked (clear to end of screen),\n\n•   kich1 (insert character or enter insert mode),\n\n•   kil1 (insert line),\n\n•   knp (next page),\n\n•   kpp (previous page),\n\n•   kind (scroll forward/down),\n\n•   kri (scroll backward/up),\n\n•   khts (set a tab stop in this column).\n\nIn  addition,  if  the  keypad  has a 3 by 3 array of keys including the four arrow keys, the\nother five keys can be given as ka1, ka3, kb2, kc1, and kc3.  These keys are useful when  the\neffects of a 3 by 3 directional pad are needed.\n\nStrings  to program function keys can be given as pfkey, pfloc, and pfx.  A string to program\nscreen labels should be specified as pln.  Each of these strings takes  two  parameters:  the\nfunction  key  number  to program (from 0 to 10) and the string to program it with.  Function\nkey numbers out of this range may program undefined keys in a terminal dependent manner.  The\ndifference between the capabilities is that pfkey causes pressing the given  key  to  be  the\nsame  as the user typing the given string; pfloc causes the string to be executed by the ter‐\nminal in local; and pfx causes the string to be transmitted to the computer.\n\nThe capabilities nlab, lw and lh define the number of programmable screen  labels  and  their\nwidth and height.  If there are commands to turn the labels on and off, give them in smln and\nrmln.   smln  is normally output after one or more pln sequences to make sure that the change\nbecomes visible.\n"
                },
                {
                    "name": "Tabs and Initialization",
                    "content": "A few capabilities are used only for tabs:\n\n•   If the terminal has hardware tabs, the command to advance to the next  tab  stop  can  be\ngiven as ht (usually control/I).\n\n•   A “back-tab” command which moves leftward to the preceding tab stop can be given as cbt.\n\nBy  convention,  if  the teletype modes indicate that tabs are being expanded by the com‐\nputer rather than being sent to the terminal, programs should not use ht or cbt  even  if\nthey are present, since the user may not have the tab stops properly set.\n\n•   If  the terminal has hardware tabs which are initially set every n spaces when the termi‐\nnal is powered up, the numeric parameter it is given, showing the number  of  spaces  the\ntabs are set to.\n\nThe  it  capability  is normally used by the tset command to determine whether to set the\nmode for hardware tab expansion, and whether to set the tab stops.  If the  terminal  has\ntab  stops  that can be saved in non-volatile memory, the terminfo description can assume\nthat they are properly set.\n\nOther capabilities include\n\n•   is1, is2, and is3, initialization strings for the terminal,\n\n•   iprog, the path name of a program to be run to initialize the terminal,\n\n•   and if, the name of a file containing long initialization strings.\n\nThese strings are expected to set the terminal into modes consistent with  the  rest  of  the\nterminfo description.  They are normally sent to the terminal, by the init option of the tput\nprogram, each time the user logs in.  They will be printed in the following order:\n\nrun the program\niprog\n\noutput\nis1 and\nis2\n\nset the margins using\nmgc or\nsmglp and smgrp or\nsmgl and smgr\n\nset tabs using\ntbc and hts\n\nprint the file\nif\n\nand finally output\nis3.\n\nMost initialization is done with is2.  Special terminal modes can be set up without duplicat‐\ning strings by putting the common sequences in is2 and special cases in is1 and is3.\n\nA set of sequences that does a harder reset from a totally unknown state can be given as rs1,\nrs2,  rf and rs3, analogous to is1 , is2 , if and is3 respectively.  These strings are output\nby reset option of tput, or by the reset program (an alias of tset), which is used  when  the\nterminal  gets into a wedged state.  Commands are normally placed in rs1, rs2 rs3 and rf only\nif they produce annoying effects on the screen and are not necessary when  logging  in.   For\nexample,  the command to set the vt100 into 80-column mode would normally be part of is2, but\nit causes an annoying glitch of the screen and is not normally needed since the  terminal  is\nusually already in 80-column mode.\n\nThe  reset  program  writes strings including iprog, etc., in the same order as the init pro‐\ngram, using rs1, etc., instead of is1, etc.  If any of rs1, rs2, rs3, or rf reset  capability\nstrings are missing, the reset program falls back upon the corresponding initialization capa‐\nbility string.\n\nIf  there  are  commands  to set and clear tab stops, they can be given as tbc (clear all tab\nstops) and hts (set a tab stop in the current column of every row).  If a  more  complex  se‐\nquence is needed to set the tabs than can be described by this, the sequence can be placed in\nis2 or if.\n\nThe  tput  reset  command uses the same capability strings as the reset command, although the\ntwo programs (tput and reset) provide different command-line options.\n\nIn practice, these terminfo capabilities are not often used in initialization of tabs (though\nthey are required for the tabs program):\n\n•   Almost all hardware terminals (at least those which supported tabs) initialized those  to\nevery eight columns:\n\nThe only exception was the AT&T 2300 series, which set tabs to every five columns.\n\n•   In particular, developers of the hardware terminals which are commonly used as models for\nmodern  terminal  emulators  provided documentation demonstrating that eight columns were\nthe standard.\n\n•   Because of this,  the  terminal  initialization  programs  tput  and  tset  use  the  tbc\n(clearalltabs) and hts (settab) capabilities directly only when the it (inittabs) ca‐\npability is set to a value other than eight.\n"
                },
                {
                    "name": "Delays and Padding",
                    "content": "Many  older and slower terminals do not support either XON/XOFF or DTR handshaking, including\nhard copy terminals and some very archaic CRTs (including, for example, DEC  VT100s).   These\nmay require padding characters after certain cursor motions and screen changes.\n\nIf  the  terminal uses xon/xoff handshaking for flow control (that is, it automatically emits\n^S back to the host when its input buffers are close to full), set xon.  This capability sup‐\npresses the emission of padding.  You can also set it for memory-mapped console  devices  ef‐\nfectively  that  do  not have a speed limit.  Padding information should still be included so\nthat routines can make better decisions about relative costs, but actual pad characters  will\nnot be transmitted.\n\nIf  pb  (padding  baud rate) is given, padding is suppressed at baud rates below the value of\npb.  If the entry has no padding baud rate, then whether padding is emitted or  not  is  com‐\npletely controlled by xon.\n\nIf  the terminal requires other than a null (zero) character as a pad, then this can be given\nas pad.  Only the first character of the pad string is used.\n"
                },
                {
                    "name": "Status Lines",
                    "content": "Some terminals have an extra “status line” which is not normally used by software  (and  thus\nnot counted in the terminal's lines capability).\n\nThe  simplest  case  is  a  status  line which is cursor-addressable but not part of the main\nscrolling region on the screen; the Heathkit H19 has a status line of this kind, as  would  a\n24-line  VT100  with  a 23-line scrolling region set up on initialization.  This situation is\nindicated by the hs capability.\n\nSome terminals with status lines need special sequences to access the status line.  These may\nbe expressed as a string with single parameter tsl which takes the cursor to  a  given  zero-\norigin  column  on the status line.  The capability fsl must return to the main-screen cursor\npositions before the last tsl.  You may need to embed the string values of sc  (save  cursor)\nand rc (restore cursor) in tsl and fsl to accomplish this.\n\nThe  status  line  is normally assumed to be the same width as the width of the terminal.  If\nthis is untrue, you can specify it with the numeric capability wsl.\n\nA command to erase or blank the status line may be specified as dsl.\n\nThe Boolean capability eslok specifies that escape sequences, tabs, etc., work ordinarily  in\nthe status line.\n\nThe  ncurses  implementation does not yet use any of these capabilities.  They are documented\nhere in case they ever become important.\n"
                },
                {
                    "name": "Line Graphics",
                    "content": "Many terminals have alternate character sets useful for forms-drawing.  Terminfo  and  curses\nhave  built-in  support  for most of the drawing characters supported by the VT100, with some\ncharacters from the AT&T 4410v1 added.  This alternate character set may be specified by  the\nacsc capability.\n\nacsc"
                },
                {
                    "name": "ACS Name      Value   Symbol   ASCII Fallback / Glyph Name",
                    "content": "──────────────────────────────────────────────────────────────────────────────────────────────\nACSRARROW    0x2b      +      >  arrow pointing right\nACSLARROW    0x2c      ,      <  arrow pointing left\nACSUARROW    0x2d      -      ^  arrow pointing up\nACSDARROW    0x2e      .      v  arrow pointing down\nACSBLOCK     0x30      0      #  solid square block\nACSDIAMOND   0x60      `      +  diamond\nACSCKBOARD   0x61      a      :  checker board (stipple)\nACSDEGREE    0x66      f      \\  degree symbol\nACSPLMINUS   0x67      g      #  plus/minus\nACSBOARD     0x68      h      #  board of squares\nACSLANTERN   0x69      i      #  lantern symbol\nACSLRCORNER  0x6a      j      +  lower right corner\nACSURCORNER  0x6b      k      +  upper right corner\nACSULCORNER  0x6c      l      +  upper left corner\nACSLLCORNER  0x6d      m      +  lower left corner\nACSPLUS      0x6e      n      +  large plus or crossover\nACSS1        0x6f      o      ~  scan line 1\nACSS3        0x70      p      -  scan line 3\nACSHLINE     0x71      q      -  horizontal line\nACSS7        0x72      r      -  scan line 7\nACSS9        0x73      s        scan line 9\nACSLTEE      0x74      t      +  tee pointing right\nACSRTEE      0x75      u      +  tee pointing left\nACSBTEE      0x76      v      +  tee pointing up\nACSTTEE      0x77      w      +  tee pointing down\nACSVLINE     0x78      x      |  vertical line\nACSLEQUAL    0x79      y      <  less-than-or-equal-to\nACSGEQUAL    0x7a      z      >  greater-than-or-equal-to\nACSPI        0x7b      {      *  greek pi\nACSNEQUAL    0x7c      |      !  not-equal\nACSSTERLING  0x7d      }      f  UK pound sign\nACSBULLET    0x7e      ~      o  bullet\n\nA few notes apply to the table itself:\n\n•   X/Open  Curses  incorrectly states that the mapping for lantern is uppercase “I” although\nUnix implementations use the lowercase “i” mapping.\n\n•   The DEC VT100 implemented graphics using the alternate character set feature, temporarily\nswitching modes and sending characters in the range 0x60 (96) to  0x7e  (126)  (the  acsc\nValue column in the table).\n\n•   The AT&T terminal added graphics characters outside that range.\n\nSome of the characters within the range do not match the VT100; presumably they were used\nin  the  AT&T terminal: board of squares replaces the VT100 newline symbol, while lantern\nsymbol replaces the VT100 vertical tab symbol.  The other VT100 symbols for control char‐\nacters (horizontal tab, carriage return and line-feed) are not (re)used in curses.\n\nThe best way to define a new device's graphics set is to add a column to a copy of this table\nfor your terminal, giving the character which (when  emitted  between  smacs/rmacs  switches)\nwill be rendered as the corresponding graphic.  Then read off the VT100/your terminal charac‐\nter pairs right to left in sequence; these become the ACSC string.\n"
                },
                {
                    "name": "Color Handling",
                    "content": "The  curses  library  functions initpair and initcolor manipulate the color pairs and color\nvalues discussed in this section (see color(3NCURSES) for details on these and related  func‐\ntions).\n\nMost color terminals are either “Tektronix-like” or “HP-like”:\n\n•   Tektronix-like  terminals  have  a predefined set of N colors (where N is usually 8), and\ncan set character-cell foreground and background characters  independently,  mixing  them\ninto N * N color pairs.\n\n•   On  HP-like  terminals,  the  user must set each color pair up separately (foreground and\nbackground are not independently settable).  Up to M color pairs may be set up  from  2*M\ndifferent colors.  ANSI-compatible terminals are Tektronix-like.\n\nSome  basic color capabilities are independent of the color method.  The numeric capabilities\ncolors and pairs specify the maximum numbers of colors and color pairs that can be  displayed\nsimultaneously.   The  op  (original  pair) string resets foreground and background colors to\ntheir default values for the terminal.  The oc string resets all colors  or  color  pairs  to\ntheir default values for the terminal.  Some terminals (including many PC terminal emulators)\nerase  screen  areas with the current background color rather than the power-up default back‐\nground; these should have the Boolean capability bce.\n\nWhile the curses library works with color pairs (reflecting the inability of some devices  to\nset foreground and background colors independently), there are separate capabilities for set‐\nting these features:\n\n•   To  change  the  current foreground or background color on a Tektronix-type terminal, use\nsetaf (set ANSI foreground) and setab (set ANSI background) or setf (set foreground)  and\nsetb  (set background).  These take one parameter, the color number.  The SVr4 documenta‐\ntion describes only setaf/setab; the XPG4 draft says that \"If the terminal supports  ANSI\nescape  sequences  to  set  background  and foreground, they should be coded as setaf and\nsetab, respectively.\n\n•   If the terminal supports other escape sequences to set background  and  foreground,  they\nshould  be  coded  as setf and setb, respectively.  The vidputs and the refresh(3NCURSES)\nfunctions use the setaf and setab capabilities if they are defined.\n\nThe setaf/setab and setf/setb capabilities take a single  numeric  argument  each.   Argument\nvalues  0-7 of setaf/setab are portably defined as follows (the middle column is the symbolic\n#define available in the header for the curses or ncurses libraries).  The terminal  hardware\nis  free  to  map  these  as  it likes, but the RGB values indicate normal locations in color\nspace.\n\nColor      #define       Value        RGB\n────────────────────────────────────────────────\nblack     COLORBLACK       0     0,   0,   0\nred       COLORRED         1     max, 0,   0\ngreen     COLORGREEN       2     0,   max, 0\nyellow    COLORYELLOW      3     max, max, 0\nblue      COLORBLUE        4     0,   0,   max\nmagenta   COLORMAGENTA     5     max, 0,   max\ncyan      COLORCYAN        6     0,   max, max\nwhite     COLORWHITE       7     max, max, max\n\nThe argument values of setf/setb historically correspond to a different mapping, i.e.,\n\nColor      #define       Value        RGB\n────────────────────────────────────────────────\nblack     COLORBLACK       0     0,   0,   0\nblue      COLORBLUE        1     0,   0,   max\ngreen     COLORGREEN       2     0,   max, 0\ncyan      COLORCYAN        3     0,   max, max\nred       COLORRED         4     max, 0,   0\nmagenta   COLORMAGENTA     5     max, 0,   max\nyellow    COLORYELLOW      6     max, max, 0\nwhite     COLORWHITE       7     max, max, max\n\nIt is important to not confuse the two sets of color capabilities; otherwise red/blue will be\ninterchanged on the display.\n\nOn an HP-like terminal, use scp with a color pair number parameter to set which color pair is\ncurrent.\n\nSome terminals allow the color values to be modified:\n\n•   On a Tektronix-like terminal, the capability ccc may be present to indicate  that  colors\ncan  be  modified.   If  so, the initc capability will take a color number (0 to colors -\n1)and three more parameters which describe the color.  These three parameters default  to\nbeing  interpreted  as  RGB  (Red, Green, Blue) values.  If the Boolean capability hls is\npresent, they are instead as HLS (Hue, Lightness, Saturation) indices.   The  ranges  are\nterminal-dependent.\n\n•   On  an HP-like terminal, initp may give a capability for changing a color pair value.  It\nwill take seven parameters; a color pair number (0 to maxpairs - 1), and two triples de‐\nscribing first background and then foreground colors.  These  parameters  must  be  (Red,\nGreen, Blue) or (Hue, Lightness, Saturation) depending on hls.\n\nOn  some  color terminals, colors collide with highlights.  You can register these collisions\nwith the ncv capability.  This is a bit mask of attributes not to be used when colors are en‐\nabled.  The correspondence with the attributes understood by curses is as follows:\n\nAttribute     Bit   Decimal   Set by\n──────────────────────────────────────\nASTANDOUT      0         1    sgr\nAUNDERLINE     1         2    sgr\nAREVERSE       2         4    sgr\nABLINK         3         8    sgr\nADIM           4        16    sgr\nABOLD          5        32    sgr\nAINVIS         6        64    sgr\nAPROTECT       7       128    sgr\nAALTCHARSET    8       256    sgr\nAHORIZONTAL    9       512    sgr1\nALEFT         10      1024    sgr1\nALOW          11      2048    sgr1\nARIGHT        12      4096    sgr1\nATOP          13      8192    sgr1\nAVERTICAL     14     16384    sgr1\nAITALIC       15     32768    sitm\n\nFor example, on many IBM PC consoles, the underline attribute collides  with  the  foreground\ncolor blue and is not available in color mode.  These should have an ncv capability of 2.\n\nSVr4 curses does nothing with ncv, ncurses recognizes it and optimizes the output in favor of\ncolors.\n"
                },
                {
                    "name": "Miscellaneous",
                    "content": "If  the terminal requires other than a null (zero) character as a pad, then this can be given\nas pad.  Only the first character of the pad string is used.  If the terminal does not have a\npad character, specify npc.  Note that ncurses implements the termcap-compatible PC variable;\nthough the application may set this value to something other than a null, ncurses  will  test\nnpc first and use napms if the terminal has no pad character.\n\nIf the terminal can move up or down half a line, this can be indicated with hu (half-line up)\nand  hd  (half-line down).  This is primarily useful for superscripts and subscripts on hard-\ncopy terminals.  If a hard-copy terminal can eject to the next page (form feed), give this as\nff (usually control/L).\n\nIf there is a command to repeat a given character a given  number  of  times  (to  save  time\ntransmitting  a  large number of identical characters) this can be indicated with the parame‐\nterized string rep.  The first parameter is the character to be repeated and  the  second  is\nthe  number  of  times  to  repeat  it.   Thus,  tparm(repeatchar,  'x',  10) is the same as\n“xxxxxxxxxx”.\n\nIf the terminal has a settable command character, such as the TEKTRONIX 4025, this can be in‐\ndicated with cmdch.  A prototype command character is chosen which is used in  all  capabili‐\nties.  This character is given in the cmdch capability to identify it.  The following conven‐\ntion  is supported on some Unix systems: The environment is to be searched for a CC variable,\nand if found, all occurrences of the prototype character are replaced with the  character  in\nthe environment variable.\n\nTerminal  descriptions  that  do  not  represent  a  specific kind of known terminal, such as\nswitch, dialup, patch, and network, should include the gn (generic) capability so  that  pro‐\ngrams  can complain that they do not know how to talk to the terminal.  (This capability does\nnot apply to virtual terminal descriptions for which the escape sequences are known.)\n\nIf the terminal has a “meta key” which acts as a shift key, setting the 8th bit of any  char‐\nacter  transmitted, this fact can be indicated with km.  Otherwise, software will assume that\nthe 8th bit is parity and it will usually be cleared.  If strings exist to  turn  this  “meta\nmode” on and off, they can be given as smm and rmm.\n\nIf  the  terminal has more lines of memory than will fit on the screen at once, the number of\nlines of memory can be indicated with lm.  A value of lm#0 indicates that the number of lines\nis not fixed, but that there is still more memory than fits on the screen.\n\nIf the terminal is one of those supported by the Unix virtual terminal protocol, the terminal\nnumber can be given as vt.\n\nMedia copy strings which control an auxiliary printer connected to the terminal can be  given\nas  mc0:  print  the  contents of the screen, mc4: turn off the printer, and mc5: turn on the\nprinter.  When the printer is on, all text sent to the terminal will be sent to the  printer.\nIt is undefined whether the text is also displayed on the terminal screen when the printer is\non.   A  variation mc5p takes one parameter, and leaves the printer on for as many characters\nas the value of the parameter, then turns the printer off.  The parameter should  not  exceed\n255.  All text, including mc4, is transparently passed to the printer while an mc5p is in ef‐\nfect.\n"
                },
                {
                    "name": "Glitches and Brain Damage",
                    "content": "Hazeltine terminals, which do not allow “~” characters to be displayed should indicate hz.\n\nTerminals  which  ignore  a  line-feed  immediately after an am wrap, such as the Concept and\nvt100, should indicate xenl.\n\nIf el is required to get rid of standout (instead of merely writing normal  text  on  top  of\nit), xhp should be given.\n\nTeleray  terminals,  where  tabs turn all characters moved over to blanks, should indicate xt\n(destructive tabs).  Note: the variable indicating this  is  now  “desttabsmagicsmso”;  in\nolder versions, it was telerayglitch.  This glitch is also taken to mean that it is not pos‐\nsible  to  position  the cursor on top of a “magic cookie”, that to erase standout mode it is\ninstead necessary to use delete and insert line.  The  ncurses  implementation  ignores  this\nglitch.\n\nThe  Beehive  Superbee, which is unable to correctly transmit the escape or control/C charac‐\nters, has xsb, indicating that the f1 key is used for escape and  f2  for  control/C.   (Only\ncertain Superbees have this problem, depending on the ROM.)  Note that in older terminfo ver‐\nsions, this capability was called “beehiveglitch”; it is now “noescctlc”.\n\nOther specific terminal problems may be corrected by adding more capabilities of the form xx.\n"
                },
                {
                    "name": "Pitfalls of Long Entries",
                    "content": "Long  terminfo  entries  are  unlikely to be a problem; to date, no entry has even approached\nterminfo's 4096-byte string-table maximum.  Unfortunately, the termcap translations are  much\nmore strictly limited (to 1023 bytes), thus termcap translations of long terminfo entries can\ncause problems.\n\nThe  man  pages  for  4.3BSD  and  older  versions of tgetent instruct the user to allocate a\n1024-byte buffer for the termcap entry.  The entry gets null-terminated by  the  termcap  li‐\nbrary,  so that makes the maximum safe length for a termcap entry 1k-1 (1023) bytes.  Depend‐\ning on what the application and the termcap library being used does, and where in the termcap\nfile the terminal type that tgetent is searching for is, several bad things can happen:\n\n•   some termcap libraries print a warning message,\n\n•   some exit if they find an entry that's longer than 1023 bytes,\n\n•   some neither exit nor warn, doing nothing useful, and\n\n•   some simply truncate the entries to 1023 bytes.\n\nSome application programs allocate more than the recommended 1K for the termcap entry; others\ndo not.\n\nEach termcap entry has two important sizes associated with it: before “tc” expansion, and af‐\nter “tc” expansion.  “tc” is the capability that tacks on another termcap entry to the end of\nthe current one, to add on its capabilities.  If a termcap entry does not use the “tc”  capa‐\nbility, then of course the two lengths are the same.\n\nThe “before tc expansion” length is the most important one, because it affects more than just\nusers  of  that  particular  terminal.   This  is  the  length  of  the entry as it exists in\n/etc/termcap, minus the backslash-newline pairs, which tgetent strips out while  reading  it.\nSome termcap libraries strip off the final newline, too (GNU termcap does not).  Now suppose:\n\n•   a termcap entry before expansion is more than 1023 bytes long,\n\n•   and the application has only allocated a 1k buffer,\n\n•   and  the  termcap library (like the one in BSD/OS 1.1 and GNU) reads the whole entry into\nthe buffer, no matter what its length, to see if it is the entry it wants,\n\n•   and tgetent is searching for a terminal type that either is the long  entry,  appears  in\nthe  termcap  file  after  the long entry, or does not appear in the file at all (so that\ntgetent has to search the whole termcap file).\n\nThen tgetent will overwrite memory, perhaps its stack, and probably core  dump  the  program.\nPrograms  like  telnet are particularly vulnerable; modern telnets pass along values like the\nterminal type automatically.  The results are almost as undesirable with a  termcap  library,\nlike  SunOS  4.1.3  and Ultrix 4.4, that prints warning messages when it reads an overly long\ntermcap entry.  If a termcap library truncates long entries, like OSF/1 3.0, it is immune  to\ndying here but will return incorrect data for the terminal.\n\nThe  “after tc expansion” length will have a similar effect to the above, but only for people\nwho actually set TERM to that terminal type, since tgetent only does “tc” expansion  once  it\nis found the terminal type it was looking for, not while searching.\n\nIn summary, a termcap entry that is longer than 1023 bytes can cause, on various combinations\nof  termcap libraries and applications, a core dump, warnings, or incorrect operation.  If it\nis too long even before “tc” expansion, it will have this effect even for users of some other\nterminal types and users whose TERM variable does not have a termcap entry.\n\nWhen in -C (translate to termcap) mode, the ncurses implementation of tic(1)  issues  warning\nmessages  when the pre-tc length of a termcap translation is too long.  The -c (check) option\nalso checks resolved (after tc expansion) lengths.\n"
                }
            ]
        },
        "FILES": {
            "content": "/etc/terminfo\ncompiled terminal description database directory\n",
            "subsections": []
        },
        "EXTENSIONS": {
            "content": "Searching for terminal descriptions in $HOME/.terminfo and TERMINFODIRS is not supported  by\nolder implementations.\n\nSome  SVr4  curses  implementations, and all previous to SVr4, do not interpret the %A and %O\noperators in parameter strings.\n\nSVr4/XPG4 do not specify whether msgr licenses movement while in  an  alternate-character-set\nmode (such modes may, among other things, map CR and NL to characters that do not trigger lo‐\ncal  motions).   The ncurses implementation ignores msgr in ALTCHARSET mode.  This raises the\npossibility that an XPG4 implementation making the opposite interpretation may need  terminfo\nentries made for ncurses to have msgr turned off.\n\nThe  ncurses  library  handles insert-character and insert-character modes in a slightly non-\nstandard way to get better update efficiency.  See  the  Insert/Delete  Character  subsection\nabove.\n\nThe parameter substitutions for setclock and displayclock are not documented in SVr4 or the\nXSI Curses standard.  They are deduced from the documentation for the AT&T 505 terminal.\n\nBe  careful  assigning  the  kmous  capability.  The ncurses library wants to interpret it as\nKEYMOUSE, for use by terminals and emulators like xterm that can return  mouse-tracking  in‐\nformation in the keyboard-input stream.\n\nX/Open Curses does not mention italics.  Portable applications must assume that numeric capa‐\nbilities  are  signed 16-bit values.  This includes the nocolorvideo (ncv) capability.  The\n32768 mask value used for italics with ncv can be confused with an absent or  cancelled  ncv.\nIf italics should work with colors, then the ncv value must be specified, even if it is zero.\n\nDifferent commercial ports of terminfo and curses support different subsets of XSI Curses and\n(in  some cases) different extensions.  Here is a summary, accurate as of October 1995, after\nwhich the commercial Unix market contracted and lost diversity.\n\n•   SVr4, Solaris, and ncurses support all SVr4 capabilities.\n\n•   IRIX supports the SVr4 set and  adds  one  undocumented  extended  string  capability  (‐\nsetpglen).\n\n•   SVr1  and  Ultrix support a restricted subset of terminfo capabilities.  The Booleans end\nwith xonxoff; the numerics with widthstatusline; and the strings with prtrnon.\n\n•   HP/UX supports the SVr1 subset, plus  the  SVr[234]  numerics  numlabels,  labelheight,\nlabelwidth,  plus  function keys 11 through 63, plus plabnorm, labelon, and labeloff,\nplus a number of incompatible string table extensions.\n\n•   AIX supports the SVr1 subset, plus function keys 11 through 63, plus a number  of  incom‐\npatible string table extensions.\n\n•   OSF/1 supports both the SVr4 set and the AIX extensions.\n",
            "subsections": []
        },
        "PORTABILITY": {
            "content": "Do  not  count  on  compiled (binary) terminfo entries being portable between commercial Unix\nsystems.  At least two implementations of terminfo (those of HP-UX  and  AIX)  diverged  from\nthose  of other System V Unices after SVr1, adding extension capabilities to the string table\nthat (in the binary format) collide with subsequent System V and XSI Curses extensions.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.  Based on pcurses by Pavel Curtis.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "infocmp(1),  tabs(1),   tic(1),   ncurses(3NCURSES),   color(3NCURSES),   terminfo(3NCURSES),\ncursesvariables(3NCURSES), printf(3), terminfovariables(3NCURSES), term(5), usercaps(5)\n\nncurses 6.4                                  2024-01-13                                  terminfo(5)",
            "subsections": []
        }
    },
    "summary": "terminfo - terminal capability database",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "infocmp",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/infocmp/1/json"
        },
        {
            "name": "tabs",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/tabs/1/json"
        },
        {
            "name": "tic",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/tic/1/json"
        },
        {
            "name": "ncurses",
            "section": "3NCURSES",
            "url": "https://www.chedong.com/phpMan.php/man/ncurses/3NCURSES/json"
        },
        {
            "name": "color",
            "section": "3NCURSES",
            "url": "https://www.chedong.com/phpMan.php/man/color/3NCURSES/json"
        },
        {
            "name": "cursesvariables",
            "section": "3NCURSES",
            "url": "https://www.chedong.com/phpMan.php/man/cursesvariables/3NCURSES/json"
        },
        {
            "name": "printf",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/printf/3/json"
        },
        {
            "name": "terminfovariables",
            "section": "3NCURSES",
            "url": "https://www.chedong.com/phpMan.php/man/terminfovariables/3NCURSES/json"
        },
        {
            "name": "term",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/term/5/json"
        },
        {
            "name": "usercaps",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/usercaps/5/json"
        }
    ]
}