1Term::Terminfo(3) User Contributed Perl Documentation Term::Terminfo(3)
2
3
4
6 "Term::Terminfo" - access the terminfo database
7
9 use Term::Terminfo;
10
11 my $ti = Term::Terminfo->new;
12
13 printf "This terminal %s do overstrike\n",
14 $ti->getflag('os') ? "can" : "cannot";
15
16 printf "Tabs on this terminal are initially every %d columns\n",
17 $ti->getnum('it');
18
19
20 printf "This terminal %s do overstrike\n",
21 $ti->flag_by_varname('over_strike') ? "can" : "cannot";
22
23 printf "Tabs on this terminal are initially every %d columns\n",
24 $ti->num_by_varname('init_tabs');
25
27 Objects in this class provide access to terminfo database entires.
28
29 This database provides information about a terminal, in three separate
30 sets of capabilities. Flag capabilities indicate the presence of a
31 particular ability, feature, or bug simply by their presence. Number
32 capabilities give the size, count or other numeric detail of some
33 feature of the terminal. String capabilities are usually control
34 strings that the terminal will recognise, or send.
35
36 Capabilities each have two names; a short name called the capname, and
37 a longer name called the varname. This class provides two sets of
38 methods, one that works on capnames, one that work on varnames.
39
40 This module optionally uses unibilium to access the terminfo(5)
41 database, if it is available at compile-time. If not, it will use
42 <term.h> and -lcurses. For more detail, see the "SEE ALSO" section
43 below.
44
46 new
47 $ti = Term::Terminfo->new( $termtype )
48
49 Constructs a new "Term::Terminfo" object representing the given
50 termtype. If $termtype is not defined, $ENV{TERM} will be used instead.
51 If that variable is empty, "vt100" will be used.
52
54 getflag
55 getnum
56 getstr
57 $bool = $ti->getflag( $capname )
58
59 $num = $ti->getnum( $capname )
60
61 $str = $ti->getstr( $capname )
62
63 Returns the value of the flag, number or string capability of the given
64 capname.
65
66 flag_by_varname
67 num_by_varname
68 str_by_varname
69 $bool = $ti->flag_by_varname( $varname )
70
71 $num = $ti->num_by_varname( $varname )
72
73 $str = $ti->str_by_varname( $varname )
74
75 Returns the value of the flag, number or string capability of the given
76 varname.
77
78 flag_capnames
79 num_capnames
80 str_capnames
81 @capnames = $ti->flag_capnames
82
83 @capnames = $ti->num_capnames
84
85 @capnames = $ti->str_capnames
86
87 Return lists of the capnames of the supported flags, numbers, and
88 strings
89
90 flag_varnames
91 num_varnames
92 str_varnames
93 @varnames = $ti->flag_varnames
94
95 @varnames = $ti->num_varnames
96
97 @varnames = $ti->str_varnames
98
99 Return lists of the varnames of the supported flags, numbers, and
100 strings
101
103 This distribution provides a small accessor interface onto terminfo. It
104 was originally created simply so I can get at the "bce" capability flag
105 of the current terminal, because screen unlike every other terminal
106 ever, doesn't do this. Grrr.
107
108 It probably also wants more accessors for things like "tparm" and
109 "tputs". I may at some point consider them.
110
112 • "unibilium" - a terminfo parsing library -
113 <https://github.com/mauke/unibilium>
114
116 Paul Evans <leonerd@leonerd.org.uk>
117
118
119
120perl v5.36.0 2022-07-22 Term::Terminfo(3)