class

Termisu::Terminfo::Database

Inherits Reference / Object

Terminfo database file locator and loader.

Searches for compiled terminfo database files in standard locations following the terminfo directory hierarchy conventions used by ncurses.

Search Order

  1. $TERMINFO environment variable
  2. $HOME/.terminfo (user-specific database)
  3. $TERMINFO_DIRS (colon-separated list)
  4. /lib/terminfo (system library)
  5. /usr/local/share/terminfo (FreeBSD ports, Homebrew)
  6. /usr/share/terminfo (standard location)

Path Formats

Supports both standard Unix and Darwin/macOS path formats:

  • Unix: /usr/share/terminfo/x/xterm-256color
  • Darwin: /usr/share/terminfo/78/xterm-256color (hex first char)

Example

db = Termisu::Terminfo::Database.new("xterm-256color")
data = db.load # => Bytes containing compiled terminfo

Constants

Log = Termisu::Logs::Terminfo

Constructors

new(name : String)

Creates a new Database instance for the given terminal name.

Parameters:

  • name: Terminal name (e.g., "xterm-256color", "linux")
Source

Instance methods

load

Loads the terminfo database for this terminal.

Searches standard locations in order until a matching database is found.

Returns the raw binary data as Bytes.

Raises an exception if no database is found in any location.

Source