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
$TERMINFOenvironment variable$HOME/.terminfo(user-specific database)$TERMINFO_DIRS(colon-separated list)/lib/terminfo(system library)/usr/local/share/terminfo(FreeBSD ports, Homebrew)/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")
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.