class
Termisu::Terminfo::Database
- Termisu::Terminfo::Database
- Reference
- Object
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
$TERMINFOenvironment variable$HOME/.terminfo(user-specific database)$TERMINFO_DIRS(colon-separated list)/lib/terminfo(system library)/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
Defined in:
termisu/terminfo/database.crConstant Summary
-
Log =
Termisu::Logs::Terminfo
Constructors
-
.new(name : String)
Creates a new Database instance for the given terminal name.
Instance Method Summary
-
#load : Bytes
Loads the terminfo database for this terminal.
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")
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.