1*0a6a1f1dSLionel Sambuc.\" $NetBSD: terminfo.5.in,v 1.20 2014/03/18 18:20:38 riastradh Exp $ 251e66a47SVivek Prakash.\" 384d9c625SLionel Sambuc.\" Copyright (c) 2009, 2010, 2011, 2013 The NetBSD Foundation, Inc. 451e66a47SVivek Prakash.\" All rights reserved. 551e66a47SVivek Prakash.\" 651e66a47SVivek Prakash.\" This code is derived from software contributed to The NetBSD Foundation 751e66a47SVivek Prakash.\" by Roy Marples. 851e66a47SVivek Prakash.\" 951e66a47SVivek Prakash.\" Redistribution and use in source and binary forms, with or without 1051e66a47SVivek Prakash.\" modification, are permitted provided that the following conditions 1151e66a47SVivek Prakash.\" are met: 1251e66a47SVivek Prakash.\" 1. Redistributions of source code must retain the above copyright 1351e66a47SVivek Prakash.\" notice, this list of conditions and the following disclaimer. 1451e66a47SVivek Prakash.\" 2. Redistributions in binary form must reproduce the above copyright 1551e66a47SVivek Prakash.\" notice, this list of conditions and the following disclaimer in the 1651e66a47SVivek Prakash.\" documentation and/or other materials provided with the distribution. 1751e66a47SVivek Prakash.\" 1851e66a47SVivek Prakash.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 1951e66a47SVivek Prakash.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2051e66a47SVivek Prakash.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2151e66a47SVivek Prakash.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2251e66a47SVivek Prakash.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2351e66a47SVivek Prakash.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2451e66a47SVivek Prakash.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2551e66a47SVivek Prakash.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2651e66a47SVivek Prakash.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2751e66a47SVivek Prakash.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2851e66a47SVivek Prakash.\" POSSIBILITY OF SUCH DAMAGE. 2951e66a47SVivek Prakash.\" 3084d9c625SLionel Sambuc.Dd January 25, 2013 3151e66a47SVivek Prakash.Dt TERMINFO 5 3251e66a47SVivek Prakash.Os 3351e66a47SVivek Prakash.Sh NAME 3451e66a47SVivek Prakash.Nm terminfo 3551e66a47SVivek Prakash.Nd terminal capability definition 3651e66a47SVivek Prakash.Sh DESCRIPTION 3751e66a47SVivek Prakash.Nm 3851e66a47SVivek Prakashdescribes the capabilities of terminals, used by programs such as 3951e66a47SVivek Prakash.Xr vi 1 , 4051e66a47SVivek Prakash.Xr rogue 6 4151e66a47SVivek Prakashand libraries such as 4251e66a47SVivek Prakash.Xr curses 3 . 4351e66a47SVivek PrakashThe 4451e66a47SVivek Prakash.Nm 4551e66a47SVivek Prakashsource described here needs to be compiled with 4651e66a47SVivek Prakash.Xr tic 1 4751e66a47SVivek Prakashto be of any use. 4851e66a47SVivek Prakash.Pp 4951e66a47SVivek PrakashEntries in 5051e66a47SVivek Prakash.Nm 5151e66a47SVivek Prakashconsist of a number of comma separated fields. 5251e66a47SVivek PrakashWhite space after each comma is ignored. 5351e66a47SVivek PrakashEmbedded commas must be escaped by using a backslash. 5451e66a47SVivek PrakashLines beginning with 5551e66a47SVivek Prakash.Sq # 5651e66a47SVivek Prakashin the first column are treated as comments. 5751e66a47SVivek PrakashBlank lines are ignored. 5851e66a47SVivek Prakash.Pp 5951e66a47SVivek PrakashThe header line must begin in column one and end with a comma. 6051e66a47SVivek PrakashInside the header line are terminal name and aliases, 6151e66a47SVivek Prakashseparated by vertical bars, the last one being the long 6251e66a47SVivek Prakashdescription of the terminal. 6351e66a47SVivek Prakash.Pp 6451e66a47SVivek PrakashCapability lines then follow, starting on column two and ending with a comma. 6551e66a47SVivek PrakashEach capability is listed by its name, followed by its value if applicable. 6651e66a47SVivek PrakashBooleans have no values, numeric values are prefixed by 6751e66a47SVivek Prakash.Sq # 6851e66a47SVivek Prakashand strings are prefixed by 6951e66a47SVivek Prakash.Sq = . 7051e66a47SVivek PrakashNumbers can range from 0 to 32767 and string values can be up to 1000 7151e66a47SVivek Prakashcharacters long. 7251e66a47SVivek PrakashThis implementation supports strings upto 32767 characters long, including the 7351e66a47SVivek Prakash.Dv NUL 7451e66a47SVivek Prakashterminator. 7551e66a47SVivek Prakash.Pp 7651e66a47SVivek PrakashSome escapes are available for strings - both 7751e66a47SVivek Prakash.Sy \eE 7851e66a47SVivek Prakashand 7951e66a47SVivek Prakash.Sy \ee 8051e66a47SVivek Prakashmap to the 8151e66a47SVivek Prakash.Dv ESC 8251e66a47SVivek Prakashcharacter, 8351e66a47SVivek Prakash.Sy ^X 8451e66a47SVivek Prakashmaps to a control-X for any appropriate X, and the sequences 8551e66a47SVivek Prakash.Sy \en , 8651e66a47SVivek Prakash.Sy \er , 8751e66a47SVivek Prakash.Sy \et , 8851e66a47SVivek Prakash.Sy \eb 8951e66a47SVivek Prakashand 9051e66a47SVivek Prakash.Sy \ef 9151e66a47SVivek Prakashmap to linefeed, return, tab, backspace, and formfeed respectively. 9251e66a47SVivek PrakashAny character can be escaped in octal, such as 9351e66a47SVivek Prakash.Sy \e072 . 9451e66a47SVivek PrakashIf you need to encode a 9551e66a47SVivek Prakash.Dv NUL 9651e66a47SVivek Prakashcharacter, it should be escaped as 9751e66a47SVivek Prakash.Sy \e200 . 9851e66a47SVivek Prakash.Pp 9951e66a47SVivek PrakashA delay in milliseconds may appear anywhere in a string capability, 10051e66a47SVivek Prakashprefixed with a dollar sign and enclosed by angled brackets, such as 10151e66a47SVivek Prakash.Sy $\*[Lt]5\*[Gt] . 10251e66a47SVivek Prakash.Ss String Parameters 10351e66a47SVivek PrakashString capabilities sometimes require parameters. 10451e66a47SVivek PrakashNormally this just involves replacing the parameter with a supplied 10551e66a47SVivek Prakashvariable; however, there are cases where the variable needs to be manipulated 10651e66a47SVivek Prakashor used in conditional expressions. 10751e66a47SVivek PrakashA stack is also provided for simple pop and push operations. 10851e66a47SVivek Prakash.Pp 10951e66a47SVivek PrakashThe below % encodings have the following meanings: 11051e66a47SVivek Prakash.Bl -tag -width %P[a-z] 11151e66a47SVivek Prakash.It Sy %% 11251e66a47SVivek Prakashoutputs % 11351e66a47SVivek Prakash.It Sy %[[:]flags][width[.precision]][doxXs] 11451e66a47SVivek Prakashflags are 11551e66a47SVivek Prakash.Dq [-+#] . 11651e66a47SVivek PrakashPrefix with 11751e66a47SVivek Prakash.Sq \&: 11851e66a47SVivek Prakashto avoid interpreting 11951e66a47SVivek Prakash.Dq %- 12051e66a47SVivek Prakashas an operator. 12151e66a47SVivek Prakash.It Sy %c 12251e66a47SVivek Prakashpop a parameter and print the character representation of it. 12351e66a47SVivek Prakash.It Sy %s 12451e66a47SVivek Prakashpop a parameter and print the string representation of it. 12551e66a47SVivek Prakash.It Sy %p[1-9] 12651e66a47SVivek Prakashpush the parameter [1-9]. 12751e66a47SVivek Prakash.It Sy %P[a-z] 12851e66a47SVivek Prakashpop a parameter and push it to dynamic variable [a-z]. 12951e66a47SVivek Prakash.It Sy %g[a-z] 13051e66a47SVivek Prakashpush the dynamic variable [a-z]. 13151e66a47SVivek Prakash.It Sy %P[A-Z] 13251e66a47SVivek Prakashpop a parameter and push it to static variable [a-z]. 13351e66a47SVivek Prakash.It Sy %g[A-Z] 13451e66a47SVivek Prakashpush the dynamic variable [A-Z]. 13551e66a47SVivek Prakash.Pp 13651e66a47SVivek PrakashStatic variables persist over 13751e66a47SVivek Prakash.Fn tparm 13851e66a47SVivek Prakashwhereas dynamic variables do not. 13951e66a47SVivek Prakash.It Sy %'c' 14051e66a47SVivek Prakashchar constant c. 14151e66a47SVivek Prakash.It Sy %{nn} 14251e66a47SVivek Prakashinteger constant nn. 14351e66a47SVivek Prakash.It Sy %l 14451e66a47SVivek Prakashpush the string length of the previously popped parameter. 14551e66a47SVivek Prakash.It Sy %+ Sy %- Sy %* Sy %/ Sy %m 14651e66a47SVivek Prakasharithmetic: pop two parameters and push the result. 14751e66a47SVivek Prakash.It Sy %& Sy %| Sy %^ 14851e66a47SVivek Prakashbit operations: pop two parameters and push the result. 14951e66a47SVivek Prakash.It Sy %! Sy %~ 15051e66a47SVivek Prakashunary operations: pop two parameters and push the result. 15151e66a47SVivek Prakash.It Sy %i 15251e66a47SVivek Prakashadd 1 to parameters 1 and 2. 15351e66a47SVivek Prakash.It Sy %? Va expr Sy %t Ic then Sy %e Ic else Sy %; 15451e66a47SVivek PrakashIf expr equates to zero then control passes to the optional else part. 15551e66a47SVivek Prakash.El 15651e66a47SVivek Prakash.Ss Boolean Capabilities 15784d9c625SLionel Sambuc.Bl -column "enter_near_quality_letter" "setcolor" "TC" "desc" 15884d9c625SLionel Sambuc.It Sy "Long name" Ta Sy "Code" Ta Sy "TC" Ta Sy "Description" 15951e66a47SVivek Prakash@BOOLCAPS@ 16051e66a47SVivek Prakash.El 16151e66a47SVivek Prakash.Ss Numeric Capabilities 16284d9c625SLionel Sambuc.Bl -column "enter_near_quality_letter" "setcolor" "TC" "Desc" 16384d9c625SLionel Sambuc.It Sy "Long name" Ta Sy "Code" Ta Sy "TC" Ta Sy "Description" 16451e66a47SVivek Prakash@NUMCAPS@ 16551e66a47SVivek Prakash.El 16651e66a47SVivek Prakash.Ss String Capabilities 16784d9c625SLionel Sambuc.Bl -column "enter_near_quality_letter" "setcolor" "TC" "Desc" 16884d9c625SLionel Sambuc.It Sy "Long name" Ta Sy "Code" Ta Sy "TC" Ta Sy "Description" 16951e66a47SVivek Prakash@STRCAPS@ 17051e66a47SVivek Prakash.El 17151e66a47SVivek Prakash.Ss A Sample Entry 17251e66a47SVivek Prakash.Bd -literal 17351e66a47SVivek Prakashvt100\||dec vt100 (w/advanced video), 17451e66a47SVivek Prakasham, xenl, msgr, mc5i, xon, 17551e66a47SVivek Prakashcols#80, it#8, lines#24, vt#3, 17651e66a47SVivek Prakashacsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, 17751e66a47SVivek Prakashcr=^M, csr=\eE[%i%p1%d;%p2%dr, tbc=\eE[3g, clear=\eE[H\eE[J$\*[Lt]50\*[Gt], 17851e66a47SVivek Prakashel1=\eE[1K$\*[Lt]3\*[Gt], el=\eE[K$\*[Lt]3\*[Gt], ed=\eE[J$\*[Lt]50\*[Gt], 17951e66a47SVivek Prakashcup=\eE[%i%p1%d;%p2%dH$\*[Lt]5\*[Gt], cud1=^J, home=\eE[H, cub1=^H, 18051e66a47SVivek Prakashcuf1=\eE[C$\*[Lt]2\*[Gt], cuu1=\eE[A$\*[Lt]2\*[Gt], enacs=\eE(B\eE)0, smacs=^N, 18151e66a47SVivek Prakashsmam=\eE[?7h, blink=\eE[5m$\*[Lt]2\*[Gt], bold=\eE[1m$\*[Lt]2\*[Gt], rev=\eE[7m$\*[Lt]2\*[Gt], 18251e66a47SVivek Prakashsmso=\eE[7m$\*[Lt]2\*[Gt], smul=\eE[4m$\*[Lt]2\*[Gt], rmacs=^O, rmam=\eE[?7l, 18351e66a47SVivek Prakashsgr0=\eE[m017$\*[Lt]2\*[Gt], rmso=\eE[m$\*[Lt]2\*[Gt], rmul=\eE[m$\*[Lt]2\*[Gt], ka1=\eEOq, 18451e66a47SVivek Prakashka3=\eEOs, kb2=\eEOr, kbs=^H, kc1=\eEOp, kc3=\eEOn, kcud1=\eEOB, 18551e66a47SVivek Prakashkent=\eEOM, kf0=\eEOy, kf1=\eEOP, kf2=\eEOQ, kf3=\eEOR, kf4=\eEOS, 18651e66a47SVivek Prakashkf5=\eEOt, kf6=\eEOu, kf7=\eEOv, kf8=\eEOl, kf9=\eEOw, kf10=\eEOx, 18751e66a47SVivek Prakashkcub1=\eEOD, kcuf1=\eEOC, kcuu1=\eEOA, rmkx=\eE[?1l\eE\*[Gt], 18851e66a47SVivek Prakashsmkx=\eE[?1h\eE=, lf1=pf1, lf2=pf2, lf3=pf3, lf4=pf4, 18951e66a47SVivek Prakashcud=\eE[%p1%dB, cub=\eE[%p1%dD, cuf=\eE[%p1%dC, cuu=\eE[%p1%dA, 19051e66a47SVivek Prakashmc0=\eE[0i, mc4=\eE[4i, mc5=\eE[5i, 19151e66a47SVivek Prakashrs2=\eE\*[Gt]\eE[?3l\eE[?4l\eE[?5l\eE[?7h\eE[?8h, rc=\eE8, sc=\eE7, 19251e66a47SVivek Prakashind=^J, ri=\eEM$\*[Lt]5\*[Gt], 19351e66a47SVivek Prakashsgr=\eE[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t016%e017%;$\*[Lt]2\*[Gt], 19451e66a47SVivek Prakashhts=\eEH, ht=^I, 19551e66a47SVivek Prakash.Ed 19651e66a47SVivek Prakash.Ss Fetching Compiled Descriptions 19751e66a47SVivek PrakashThis implementation uses hashed databases managed by 1980c3ae37fSLionel Sambuc.Xr cdb 5 19951e66a47SVivek Prakashinstead of directories. 20051e66a47SVivek PrakashTo maintain compatability with other implementations, 2010c3ae37fSLionel Sambuc.Pa .cdb 20251e66a47SVivek Prakashis appended to each file checked. 20351e66a47SVivek Prakash.Pp 20451e66a47SVivek PrakashIf the environment variable 20551e66a47SVivek Prakash.Ev TERMINFO 20651e66a47SVivek Prakashis available, does not begin with 20751e66a47SVivek Prakash.Pq Sq / , 20851e66a47SVivek Prakashcan be compiled with the above rules and whose name matches 20951e66a47SVivek Prakash.Ev TERM 21051e66a47SVivek Prakashthen it is used. 21151e66a47SVivek Prakash.Pp 21251e66a47SVivek PrakashIf the environment variable 21351e66a47SVivek Prakash.Ev TERMCAP 21451e66a47SVivek Prakashis available and does not begin with a slash 21551e66a47SVivek Prakash.Pq Sq / 21651e66a47SVivek Prakashthen it will be translated into 21751e66a47SVivek Prakashterminfo and compiled as above. 21851e66a47SVivek PrakashIf its name matches 21951e66a47SVivek Prakash.Ev TERM 22051e66a47SVivek Prakashthen it is used. 22151e66a47SVivek Prakash.Pp 22251e66a47SVivek PrakashIf the environment variable 22351e66a47SVivek Prakash.Ev TERMINFO 22451e66a47SVivek Prakashis available and begins with a slash 22551e66a47SVivek Prakash.Pq Sq / 22651e66a47SVivek Prakashthen only this file is searched. 22751e66a47SVivek PrakashOtherwise 22851e66a47SVivek Prakash.Nm 22951e66a47SVivek Prakashwill first look for 23051e66a47SVivek Prakash.Pa $HOME/.terminfo , 23151e66a47SVivek Prakashfollowed by 23251e66a47SVivek Prakash.Pa /usr/share/misc/terminfo 23351e66a47SVivek Prakashunless 23451e66a47SVivek Prakash.Ev TERMINFO_DIRS 23551e66a47SVivek Prakashis available. 23651e66a47SVivek PrakashIf a matching description is not found then a small embedded database is 23751e66a47SVivek Prakashsearched, which currently holds descriptions for ansi, dumb, vt100, vt220, 23851e66a47SVivek Prakashwsvt25, and xterm. 23951e66a47SVivek Prakash.Sh FILES 2400c3ae37fSLionel Sambuc.Bl -tag -width /usr/share/misc/terminfo.cdb -compact 2410c3ae37fSLionel Sambuc.It Pa $HOME/.terminfo.cdb 24251e66a47SVivek PrakashDatabase of terminal descriptions for personal use. 24351e66a47SVivek Prakash.It Pa /usr/share/misc/terminfo 24451e66a47SVivek PrakashFile containing terminal descriptions. 2450c3ae37fSLionel Sambuc.It Pa /usr/share/misc/terminfo.cdb 24651e66a47SVivek PrakashDatabase of terminal descriptions. 24751e66a47SVivek Prakash.El 24851e66a47SVivek Prakash.Sh SEE ALSO 24951e66a47SVivek Prakash.Xr infocmp 1 , 25051e66a47SVivek Prakash.Xr tic 1 , 25151e66a47SVivek Prakash.Xr tput 1 , 25251e66a47SVivek Prakash.Xr curses 3 , 2530c3ae37fSLionel Sambuc.Xr cdb 5 25451e66a47SVivek Prakash.Sh STANDARDS 25551e66a47SVivek Prakash.Nm 25651e66a47SVivek Prakashcomplies with the 25751e66a47SVivek Prakash.St -xcurses4.2 25851e66a47SVivek Prakashstandard. 25951e66a47SVivek Prakash.Pp 26051e66a47SVivek PrakashExtensions to the standard are noted in 26151e66a47SVivek Prakash.Xr tic 1 . 26251e66a47SVivek Prakash.Sh AUTHORS 26384d9c625SLionel Sambuc.An Roy Marples Aq Mt roy@NetBSD.org 264