From HaskellWiki
< Library
Revision as of 09:49, 25 December 2006 by JeanPhilippeBernardy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A very simple terminal interface library.

In 150 non-blank non-comment lines of Haskell (and 7 lines of C) vty provides:

  • Automatic handling of suspend/resume (SIGTSTP+SIGCONT)
  • Automatic handling of window resizes
  • Automatic computation of minimal differences
  • Minimizes repaint area, thus virtually eliminating the flicker problem that plagues ncurses programs
  • Automatically decodes keyboard keys into (key,[modifier]) tuples
  • Automatically supports refresh on Ctrl-L.
  • Automatically supports timeout after 50ms for lone ESC (a barely noticable delay)
  • Interface is designed for relatively easy compatible extension.

Current disadvantages:

  • No current support for non-ANSI terminals.
  • Minimal support for special keys on terminals other than the linux-console. (F1-5 and arrow keys should work, but anything shifted isn't likely to.)
  • Uses the TIOCGWINSZ ioctl to find the current window size, which appears to be limited to Linux and *BSD.

darcs get --tag=rel-1.0

To compile the demonstration program: ghc --make Test.hs gwinsz.c