Difference between revisions of "Library/VTY"
< Library
Jump to navigation
Jump to search
BrettGiles (talk | contribs) m (Categorize) |
m (Corrected wrong links (at least)) |
||
(One intermediate revision by one other user not shown) | |||
Line 12: | Line 12: | ||
* Automatically supports refresh on Ctrl-L. |
* Automatically supports refresh on Ctrl-L. |
||
* Automatically supports timeout after 50ms for lone ESC (a barely noticable delay) |
* Automatically supports timeout after 50ms for lone ESC (a barely noticable delay) |
||
+ | * Extensive color scheme support: background colors, default colors, reverse-video, bold, underline, half-bright, and blinking attributes. |
||
+ | * Unicode characters on output, automatically setting and resetting UTF-8 mode (beware double width and combining characters!) |
||
+ | * Disables ISIG and IXOFF, allowing C-q, C-s, C-c, C-z, and C-\ to be received as input. |
||
* Interface is designed for relatively easy compatible extension. |
* Interface is designed for relatively easy compatible extension. |
||
Line 19: | Line 22: | ||
* Uses the TIOCGWINSZ ioctl to find the current window size, which appears to be limited to Linux and *BSD. |
* Uses the TIOCGWINSZ ioctl to find the current window size, which appears to be limited to Linux and *BSD. |
||
− | + | http://hackage.haskell.org/package/vty |
|
− | http:// |
+ | darcs get http://code.haskell.org/vty/ |
− | |||
− | To compile the demonstration program: ghc --make Test.hs gwinsz.c |
Latest revision as of 18:39, 4 May 2010
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)
- Extensive color scheme support: background colors, default colors, reverse-video, bold, underline, half-bright, and blinking attributes.
- Unicode characters on output, automatically setting and resetting UTF-8 mode (beware double width and combining characters!)
- Disables ISIG and IXOFF, allowing C-q, C-s, C-c, C-z, and C-\ to be received as input.
- 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.
http://hackage.haskell.org/package/vty
darcs get http://code.haskell.org/vty/