Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.
/ pony-terminfo Public archive

Snazzify your Pony text interfaces with a terminfo replacement 🐴

License

Notifications You must be signed in to change notification settings

mvzink/pony-terminfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pony-terminfo

Let's do cool stuff in terminals!

Let's print "Greetings Pony!", but underline the word "Pony". And make it blue.

use "terminfo"

actor Main
  new create(env: Env) =>
    try
      let db = GetTerminalInfo(env)
      env.out.print("Greetings " + db.set_a_foreground(4) +
                    db.enter_underline_mode() + "Pony" +
                    db.exit_attribute_mode() + "!")
    end

This is a Pony reimplementation of terminfo/libtinfo.

Currently supports:

  • Detect terminal type... okay, well, only from $TERM. And we only look for the entry in /usr/share/terminfo, but it could be in other places. (TODO.)
  • Parse the corresponding compiled terminfo database and shove all the capabilities into a HashMap.
  • Wrap it (with types!) so you don't have to hardcode strings yourself.
  • Evaluate parameterized string capabilities (such as sgr/set_attributes).

About

Snazzify your Pony text interfaces with a terminfo replacement 🐴

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages