Term::Terminfo(3pm)
hey bestie!! welcome to Term::Terminfo(3pm), fresh from the User Contributed Perl Documentation π this is the page where we access the terminfo database, and itβs lowkey iconic. no cap.
πΈ NAME πΈ
Term::Terminfo β access the terminfo database. periodt.
β¨ SYNOPSIS β¨
okay so hereβs the whole vibe in code, bestie:
use Term::Terminfo;
my $ti = Term::Terminfo->new;
printf "This terminal %s do overstrike\n",
$ti->getflag('os') ? "can" : "cannot";
printf "Tabs on this terminal are initially every %d columns\n",
$ti->getnum('it');
printf "This terminal %s do overstrike\n",
$ti->flag_by_varname('over_strike') ? "can" : "cannot";
printf "Tabs on this terminal are initially every %d columns\n",
$ti->num_by_varname('init_tabs');
π DESCRIPTION π
Objects in this class give you access to terminfo database entries. yes bestie, entries. weβre being normal about it.
This database has all the tea about a terminal, split into three separate sets of capabilities:
- Flag capabilities β they indicate the presence of a particular ability, feature, or bug just by being present.
- Number capabilities β they give the size, count, or other numeric detail of some feature of the terminal.
- String capabilities β usually control strings that the terminal will recognise, or send.
Capabilities each have two names: a short name called the capname, and a longer name called the varname. This class provides two sets of methods β one set works on capnames, and one set works on varnames.
This module optionally uses unibilium to access the terminfo(5) database, if it is available at compile-time. If not, it will use <term.h> and -lcurses. For more detail, see the SEE ALSO section below.
π CONSTRUCTOR π
π new π
$ti = Term::Terminfo->new( $termtype )
Constructs a new Term::Terminfo object representing the given termtype. If $termtype is not defined, $ENV{TERM} will be used instead. If that variable is empty, vt100 will be used. slay.
π METHODS π
β¨ getflag / getnum / getstr β¨
$bool = $ti->getflag( $capname )
$num = $ti->getnum( $capname )
$str = $ti->getstr( $capname )
Returns the value of the flag, number, or string capability of the given capname.
π¦ flag_by_varname / num_by_varname / str_by_varname π¦
$bool = $ti->flag_by_varname( $varname )
$num = $ti->num_by_varname( $varname )
$str = $ti->str_by_varname( $varname )
Returns the value of the flag, number, or string capability of the given varname.
π flag_capnames / num_capnames / str_capnames π
@capnames = $ti->flag_capnames
@capnames = $ti->num_capnames
@capnames = $ti->str_capnames
Return lists of the capnames of the supported flags, numbers, and strings.
π flag_varnames / num_varnames / str_varnames π
@varnames = $ti->flag_varnames
@varnames = $ti->num_varnames
@varnames = $ti->str_varnames
Return lists of the varnames of the supported flags, numbers, and strings.
π«Ά TODO π«Ά
This distribution provides a small accessor interface onto terminfo. It was originally created simply so I can get at the bce capability flag of the current terminal, because screen β unlike every other terminal ever β doesnβt do this. Grrr.
It probably also wants more accessors for things like tparm and tputs. I may at some point consider them.
π SEE ALSO π
unibiliumβ a terminfo parsing library βhttps://github.com/mauke/unibilium
π¦ AUTHOR π¦
Paul Evans <leonerd@leonerd.org.uk>
mwah π β this page is from perl v5.42.0, dated 2025-02-06. byeee bestie π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: perl-Term-Terminfo 0.09-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Term-Terminfo 0.09-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Term-Terminfo 0.09-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Term-Terminfo 0.09-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms