Skip to content

[WIP] A Crystal library to parse terminfo database

License

Notifications You must be signed in to change notification settings

docelic/terminfo.cr

Repository files navigation

terminfo - WIP - API NOT STABLE AT ALL!

[WIP] A Crystal library to parse and use terminfo database

DO NOT USE, the API might change!

Installation

Add this to your application's shard.yml:

dependencies:
  terminfo:
    github: bew/terminfo.cr

Usage

See the samples and the database specs for up-to-date usage examples.

require "terminfo"

# do stuff..

Development

Also see dev notes.

Progress

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)
  • ...

Used references

unibilium

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

Misc

Cool lib termfest (rust) (using term, see above)

Contributing

  1. Fork it ( https://github.com/bew/terminfo.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Also, feel free to open an issue for anything (feature idea, implementation idea, just discuss about the project).

Contributors

  • bew Benoit de Chezelles - creator, maintainer

About

[WIP] A Crystal library to parse terminfo database

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published