class Termisu::Terminfo::Database

Overview

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/share/terminfo (standard location)

Path Formats

Supports both standard Unix and Darwin/macOS path formats:

Example

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

Defined in:

termisu/terminfo/database.cr

Constant Summary

Log = Termisu::Logs::Terminfo

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String) #

Creates a new Database instance for the given terminal name.

Parameters:

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

[View source]

Instance Method Detail

def load : Bytes #

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.


[View source]