[WIP] A Crystal library to parse and use terminfo database
DO NOT USE, the API might change!
Add this to your application's shard.yml
:
dependencies:
terminfo:
github: bew/terminfo.cr
See the samples and the database specs for up-to-date usage examples.
require "terminfo"
# do stuff..
Also see dev notes.
Done:
- Search terminfo database in standards directories from the terminal name
- Terminfo database parsing to a
Terminfo::Database
object (extracts all standards number/boolean/string capabilities) - Get/Set number/boolean/string capabilities
TODO:
- Parameterized string parser & executor (see references below)
- Documentation
- Parser specs
- Allow to generate a terminfo database from a Terminfo object (to be used in parser specs)
- Allow to parse & query/set terminfo extensions (non-standards capabilities)
- (maybe) Make names database (
src/terminfo/names.cr
) less memory hungry? - Find a good API!!! (test small projects for that)
- ...
term (rust): A Rust library for terminfo parsing and terminal colors.
terminfo (go): Terminfo for Go
rust-terminfo (rust): Terminfo for Rust
- param expander: It uses a kind of iterator producing states, and switching on each state.
Compiled terminfo format man page: https://www.systutorials.com/docs/linux/man/5-term/
Source terminfo format: http://pubs.opengroup.org/onlinepubs/7908799/xcurses/terminfo.html (not used ATM)
Full (almost) doc on terminfo, param strings, usages, etc.. linux - man5 - terminfo
About Control Functions, Escape Sequences, and VT-Keys (not official, but still interesting!) Control characters
Full XTerm Control Sequences doc: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
Cool lib termfest (rust) (using term
, see above)
- Fork it ( https://github.com/bew/terminfo.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Also, feel free to open an issue for anything (feature idea, implementation idea, just discuss about the project).
- bew Benoit de Chezelles - creator, maintainer