4

I am trying to understand the use of toe command.
From the man pages it's difficult for me to figure out what the command does.
Plus I cannot find any examples on the internet.

from the manpage:

toe - table of (terminfo) entries
[..] lists all available terminal types by primary name with descriptions

Can someone try to provide a simple explanation with examples?

1
  • IMHO, its only purpose is to squat a nice 3 letter command name that could've been used for something more useful ;-)
    – user313992
    Jan 22, 2020 at 15:24

2 Answers 2

7

toe lists the terminal descriptions known to Terminfo on the system; by default it only lists descriptions stored in its default directory, rather than all the locations it knows about (e.g. /etc/terminfo on Debian-based systems), so

toe

often produces no output. To see something useful, run

toe -ha

This will list all the Terminfo database entries, with a header showing where they come from:

$ toe -ha
#
#/etc/terminfo:
#
#
#/lib/terminfo:
#
hurd            The GNU Hurd console server
wsvt25m         NetBSD wscons in 25 line DEC VT220 mode with Meta
wsvt25          NetBSD wscons in 25 line DEC VT220 mode
linux           linux console

etc.

Each line starts with a value which can be used with the TERM variable so that Terminfo-compatible programs will use the corresponding terminal description. You might recognise xterm and its variants in the list...

6
  • 1
    Why would it default to something that doesn't specify anything? Historical reasons?
    – terdon
    Jan 22, 2020 at 14:05
  • 1
    I guess so. IIRC, admins used to copy useful entries to /etc/terminfo for speed reasons, so by listing only that, users saw what was relevant... Jan 22, 2020 at 14:16
  • /etc/terminfo is Debian-specific. Others have chosen differently, even considering just Linux operating systems alone.
    – JdeBP
    Jan 22, 2020 at 18:30
  • @JdeBP fedora/rhel based distros also use /etc/terminfo (ie ncurses apps start by looking into /etc/terminfo by default). It's tic which only in Debian-like writes the compiled entries into /etc/terminfo by default.
    – user313992
    Jan 22, 2020 at 18:40
  • @JdeBP since 2006, see the ncurses.spec file inside ncurses-6.1-12.20190803.fc31.src.rpm
    – user313992
    Jan 22, 2020 at 18:51
4

As mentionned in toe documentation (man 1 toe), it will list you the terminfo entries on the

toe(1)                      General Commands Manual                     toe(1)

NAME
       toe - table of (terminfo) entries

SYNOPSIS
       toe [-v[n]] [-ahsuUV] file...

DESCRIPTION
       With no options, toe lists all available terminal types by primary name
       with descriptions.   File  arguments  specify  the  directories  to  be
       scanned;  if  no such arguments are given, your default terminfo direc‐

For example, terminfo entries on my system are stored under /usr/share/terminfo :

$ toe /usr/share/terminfo/ |head -n 10
jaixterm-m  IBM Kanji AIXterm Monochrome Terminal Emulator
jaixterm    IBM Kanji Aixterm Terminal Eemulator
microb      micro bee series
mime        microterm mime1
megatek     pegasus workstation terminal emulator
m2-nam      France Telecom Minitel 2 mode te'le'informatique
mlterm+pcfkeys  fragment for PC-style fkeys
mgterm      MGL/MGL2 MobileGear Graphic Library
ms-vt100    MS telnet imitating dec vt100
mime2a-s    microterm mime2a (emulating an enhanced soroc iq120)

I limited the output... Now, for what terminfo is, just have a look to man 5 terminfo:

terminfo(5)                      File Formats                      terminfo(5)

NAME
       terminfo - terminal capability data base

SYNOPSIS
       /etc/terminfo/*/*

DESCRIPTION
       Terminfo  is  a data base describing terminals, used by screen-oriented
       programs   such   as   nvi(1),   rogue(1)   and   libraries   such   as
       ncurses(3NCURSES).  Terminfo describes terminals by giving a set of ca‐
       pabilities which they have, by specifying how to perform screen  opera‐
       tions,  and  by  specifying padding requirements and initialization se‐
       quences.  This describes ncurses version 6.1 (patch 20181013).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .