Copyright (c) 2009 The NetBSD Foundation, Inc.
All rights reserved.
This code is derived from software contributed to The NetBSD Foundation
by Roy Marples.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
.Dd October 1, 2009 .Dt TERMINFO 5 .Os .Sh NAME .Nm terminfo .Nd terminal capability definition .Sh DESCRIPTION .Nm describes the capabilities of terminals, used by programs such as .Xr vi 1 , .Xr rogue 6 and libraries such as .Xr curses 3 . The .Nm source described here needs to be compiled with .Xr tic 1 to be of any use.
p Entries in .Nm consist of a number of comma seperated fields. White space after each comma is ignored. Embedded commas must be escaped by using a backslash. Lines beginning with # in the first column are treated as comments. Blank lines are ignored.
p The header line must begin in column one and end with a comma. Inside the header line are terminal name and aliases, seperated by vertical bars, the last one being the long description of the terminal.
p Capability lines then follow, starting on column two and end with a comma. Each capability is listed by its name, followed by its value if applicable. Booleans have no values, numeric values are prefixed by # and strings are prefixed by =. Numbers can range from 0 to 32767 and string values can be up to 1000 characters long. This implementation supports strings upto 32767 characters long, including the .Dv NUL terminator.
p Some escapes are available for strings - both .Sy \eE and .Sy \ee map to the .Dv ESC character, .Sy ^X maps to a control-X for any appropriate X, and the sequences .Sy \en , .Sy \er , .Sy \et , .Sy \eb and .Sy \ef map to linefeed, return, tab, backspace and formfeed respectively. Any character can be escaped in octal, such as .Sy \e072 . If you need to encode a .Dv NUL character, it should be escaped as .Sy \e200 .
p A delay in milliseconds my appear anywhere in a string capability, prefixed with a dollar and enclosed by angled brackets, such as .Sy $<5> . .Ss String Parameters String capabilities sometimes requires parameters. Normally this just involves replacing the parameter with a supplied variable, however there are cases where the variable need to be manipulated or used in conditional expressions. A stack is also provided for simple pop and push operations.
p The below % encodings have the following meanings: l -tag -width %P[a-z] t Sy %% outputs % t Sy %[[:]flags][width[.precision]][doxXs] flags are [-+# ]. Prefix with : to avoid interpreting %- as an operator. t Sy %c pop a parameter and print the character representation of it. t Sy %s pop a parameter and print the string representation of it. t Sy %p[1-9] push the parameter [1-9]. t Sy %P[a-z] pop a parameter and push it to dynamic variable [a-z]. t Sy %g[a-z] push the dynamic variable [a-z]. t Sy %P[A-Z] pop a parameter and push it to static variable [a-z]. t Sy %g[A-Z] push the dynamic variable [A-Z].
p Static variables persist over .Fn tparm where-as dyanmic variables do not. t Sy %'c' char constant c. t Sy %{nn} integer constant nn. t Sy %l push the string length of the previously popped parameter. t Sy %+ Sy %- Sy %* Sy %/ Sy %m arithmetic: pop two parameters and push the result. t Sy %& Sy %| Sy %^ bit operations: pop two parameters and push the result. t Sy %! Sy %~ unary operations: pop two parameters and push the result. t Sy %i add 1 to parameters 1 and 2. t Sy %? Va expr Sy %t Ic then Sy %e Ic else Sy %; If expr equates to zero then contol passes to the optional else part. .El .Ss Boolean Capabilities l -column "enter_near_quality_letter" "setcolor" "TC" t Sy "Long name" Ta Sy "Code" Ta Sy "TC" @BOOLCAPS@ .El .Ss Numeric Capabilities l -column "enter_near_quality_letter" "setcolor" "TC" t Sy "Long name" Ta Sy "Code" Ta Sy "TC" @NUMCAPS@ .El .Ss String Capabilities l -column "enter_near_quality_letter" "setcolor" "TC" t Sy "Long name" Ta Sy "Code" Ta Sy "TC" @STRCAPS@ .El .Ss A Sample Entry d -literal vt100\||dec vt100 (w/advanced video), am, xenl, msgr, mc5i, xon, cols#80, it#8, lines#24, vt#3, acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, cr=^M, csr=\eE[%i%p1%d;%p2%dr, tbc=\eE[3g, clear=\eE[H\eE[J$<50>, el1=\eE[1K$<3>, el=\eE[K$<3>, ed=\eE[J$<50>, cup=\eE[%i%p1%d;%p2%dH$<5>, cud1=^J, home=\eE[H, cub1=^H, cuf1=\eE[C$<2>, cuu1=\eE[A$<2>, enacs=\eE(B\eE)0, smacs=^N, smam=\eE[?7h, blink=\eE[5m$<2>, bold=\eE[1m$<2>, rev=\eE[7m$<2>, smso=\eE[7m$<2>, smul=\eE[4m$<2>, rmacs=^O, rmam=\eE[?7l, sgr0=\eE[m017$<2>, rmso=\eE[m$<2>, rmul=\eE[m$<2>, ka1=\eEOq, ka3=\eEOs, kb2=\eEOr, kbs=^H, kc1=\eEOp, kc3=\eEOn, kcud1=\eEOB, kent=\eEOM, kf0=\eEOy, kf1=\eEOP, kf2=\eEOQ, kf3=\eEOR, kf4=\eEOS, kf5=\eEOt, kf6=\eEOu, kf7=\eEOv, kf8=\eEOl, kf9=\eEOw, kf10=\eEOx, kcub1=\eEOD, kcuf1=\eEOC, kcuu1=\eEOA, rmkx=\eE[?1l\eE>, smkx=\eE[?1h\eE=, lf1=pf1, lf2=pf2, lf3=pf3, lf4=pf4, cud=\eE[%p1%dB, cub=\eE[%p1%dD, cuf=\eE[%p1%dC, cuu=\eE[%p1%dA, mc0=\eE[0i, mc4=\eE[4i, mc5=\eE[5i, rs2=\eE>\eE[?3l\eE[?4l\eE[?5l\eE[?7h\eE[?8h, rc=\eE8, sc=\eE7, ind=^J, ri=\eEM$<5>, sgr=\eE[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t016%e017%;$<2>, hts=\eEH, ht=^I, .Ed .Ss Fetching Compiled Descriptions If the environment variable .Ev TERMINFO is available, .db is appended to it and only this database is used. Otherwise .Nm will first look for
a $HOME/.terminfo.db , followed by
a /usr/share/misc/terminfo.db and
a /etc/terminfo.db . .Sh FILES l -tag -width /usr/share/misc/terminfo.db -compact t Pa $HOME/.terminfo.db Database of terminal descriptions for personal use. t Pa /etc/terminfo.db Database of terminal descriptions for use during boot or single user. t Pa /usr/share/misc/terminfo File containing terminal descriptions. t Pa /usr/share/misc/terminfo.db Database of terminal descriptions. .El .Sh SEE ALSO .Xr infocmp 1 , .Xr tic 1 , .Xr tput 1 , .Xr curses 3 .Sh STANDARDS .Nm complies with the .St -xcurses4.2 standard.
p Extentions to the standard are noted in .Xr tic 1 . .Sh AUTHORS .An Roy Marples Aq roy@NetBSD.org