~sircmpwn/hare-vt

8d05cf7ee359e84080971f9e123112ff4a0462ea — Drew DeVault 1 year, 1 month ago 61657cb
vt/README: initial commit
2 files changed, 15 insertions(+), 5 deletions(-)

A vt/README
M vt/xterm.ha
A vt/README => vt/README +10 -0
@@ 0,0 1,10 @@
The vt package provides abstractions for visual terminal drivers.

To open the most appropriate terminal for the current process, see [[open]]; to
open a specific terminal, see [[openfile]]. Call [[close]] when done in order to
restore the terminal's previous state.

Terminal objects returned by [[open]] et al implement [[io::stream]], you can
read from or write to them normally to directly access the underlying terminal
file. For formatted printing, see [[print]] et al. To process input events, see
[[getevent]] and [[pollevent]].

M vt/xterm.ha => vt/xterm.ha +5 -5
@@ 58,6 58,11 @@ fn xterm_write(term: *io::stream, buf: const []u8) (size | io::error) = {
	return io::write((term: *xterm).out, buf);
};

fn xterm_pollev(term: *term, block: bool) (void | event | io::EOF | error) = {
	let term = term: *xterm;
	abort(); // TODO
};

fn xterm_chpen(term: *term, pen: *pen) (void | error) = {
	let term = term: *xterm;
	const old = term.pen;


@@ 88,11 93,6 @@ fn xterm_chpen(term: *term, pen: *pen) (void | error) = {
	fmt::fprint(term.out, "m")?;
};

fn xterm_pollev(term: *term, block: bool) (void | event | io::EOF | error) = {
	let term = term: *xterm;
	abort(); // TODO
};

fn xterm_fgstr(out: io::file, c: anycolor) (void | io::error) = {
	match (c) {
	case void =>