Skip to content

craigbarnes/lua-terminfo-parser

Repository files navigation

terminfo-parser

This is a Lua parser for the terminfo source format used by ncurses. It's intended to allow querying and transforming the database via scripting, in a manner that's more flexible and performant than using the command-line tools (i.e. infocmp, tput, etc.).

Note: This library is not intended to replace the terminfo or curses C APIs. Many control sequences in the database must be passed through tparm(3) and/or tputs(3) before being sent to a terminal. Use Lua bindings for the C APIs if you need a terminal control library.

Usage

See the scripts in the examples/ directory for a demonstration of how to use the library and the kinds of queries that can be performed. For quick reference, the output for most of these scripts can also be found under examples/output/.

Since the intended use case of the library is running ad-hoc queries on terminfo.src, there are no official packages or versioned releases.

Requirements

License

Copyright © 2018-2024 Craig Barnes.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more details.