libtty
a library for handling vt100-like pseudo-terminals
- Provided by: libtty-dev (Version: 0.19-1)
- Source: termrec
- Report a bug
a library for handling vt100-like pseudo-terminals
#include <tty.h>
Link with -ltty.
You'll most likely be interested in the following fields of the structure:
scr is an array of character/attribute pairs, more exactly, each element is a struct "{ ucs ch; int attr; }". The array is a flat one of vt->sx*vt->sy elements, arranged row by row. A screen coordinate x,y is stored at x+y*vt->sy.
For other fields, please RTFS the header itself: tty.h
Well, you have written some data to the terminal. Now you probably want to put it somewhere. What now? The tty structure has a number of event hooks that you can attach your functions to.
These hooks are callbacks inside the tty structure that you can set. The callback fields are:
If an endpoint spills outside of the current line, it will go all the way to an end of screen.
If the cursor moves, you'll get a separate l_cursor, although it is already in place during the l_clear call.
There's no separare l_cursor event, cx and cy are already updated.
cursor visibility
application keypad mode (more detailed codes for keypad arrow keys)
For the case when you want the output go to a real terminal, there are:
The redirection will last until the terminal is destroyed by tty_free().