Documentation ¶
Overview ¶
Package terminfo contains a simple and incomplete implementation of the terminfo database. Information was taken from the ncurses manpages term(5) and terminfo(5). Currently, only the string capabilities for special keys and for functions without parameters are actually used. Colors are still done with ANSI escape sequences. Other special features that are not (yet?) supported are reading from ~/.terminfo, the TERMINFO_DIRS variable, Berkeley database format and extended capabilities.
It is currently in the process of evolving out of termbox, and will become more complete over time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SearchPath ¶
func SearchPath() []string
SearchPath returns candidate file paths to try to load from; this follows the behaviour described in terminfo(5) as distributed by ncurses.
Types ¶
type Terminfo ¶
Terminfo describes how to interact with a terminal.
func GetBuiltin ¶
GetBuiltin returns a named builtin Terminfo.
func Load ¶
Load Terminfo for the given terminal name. Unless you know better, you want to pass the value of os.Getenv("TERM")`. No default is currently provided, so an error will be returned for the empty string. Loaded Terminfo is cached on success, and the same value returned next time. Some builtins are provided for common terminals, and will be used if reading from the terminfo database fails.
func (Terminfo) FuncMap ¶
FuncMap builds and returns a string-string map of the control sequence functions defined for callers that are more interested in flexibility than performance.