I notice that ncurses's terminfo database on /usr/share/terminfo is about 7MB (I compiled it myself). This is too large if I want to deploy it on an embedded Linux of 64MB disk space.

Is there a way to reduce its size by deleting unneeded entries and keep the most-used ones? And what's is this actually for?

EDIT: Is there any info or reference for commonly used terminfo for regular PCs or SSH clients?


With ansi, cygwin, linux, vt100, vt220, and xterm terminfo definitions, I expect you'd be able to hit 98% of the terminal emulations that you'll encounter in the wild.

Even terminal emulators that have a different native mode can likely be directed to emulate vt100/vt220 modes, often without user intervention.


Rather than deleting entries, the usual approach for constructing small terminfo databases is by building up just the parts needed:


I hate to give RTFM type answers, but what information are you looking for that isn't contained in man 5 terminfo? It is often easy to overlook manual pages when there are multiple manual pages in different sections. Often the other manual pages to look at will be listed at the bottom of the first manual page that is found, but it is also helpful to remember that manual pages are divided into multiple sections(from man man):

   1   Executable programs or shell commands
   2   System calls (functions provided by the kernel)
   3   Library calls (functions within program libraries)
   4   Special files (usually found in /dev)
   5   File formats and conventions eg /etc/passwd
   6   Games
   7   Miscellaneous  (including  macro  packages  and  conventions)
   8   System administration commands (usually only for root)
   9   Kernel routines [Non standard]

From man 5 terminfo it seems that how much you can get rid of from /usr/share/terminfo will depend on whether you have complete control over the terminal type (which you likely do). If you know that you will only ever be running on one terminal type, you can likely remove all but one of the terminal discriptions. On some systems, these terminfo files are also in /etc/terminfo/ or /lib/terminfo/, but I am unsure if this is the case when you compile directly from the upstream tarball.

  • there are about 2600 terminfo database, I can pick one based on infocmp of terminal that I'am currently used, but just to be safe, I just want to know is there any info or reference for commonly used terminfo for regular PC or SSHclient – uray Sep 6 '10 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.