(chibi stty)

A high-level interface to stty and ioctl.

(stty)

(stty [port] args ...)

Set the terminal attributes for port (default (current-output-port)) to attrs. Attributes are specified symbolically using the names from the stty(1) command. In addition, (not args ...) may be used to negate the listed symbols.

(with-stty setting thunk [port])

Run thunk with the stty settings in effect during its dynamic extent, resetting the original settings when it returns.

(with-raw-io port thunk)

Run thunk with the "raw" (no canonical or echo) options needed for a terminal application.

(get-terminal-width x)

Returns the current terminal width in characters of x, which must be a port or a file descriptor.

(get-terminal-dimensions x)

Returns the current terminal dimensions, as a list of character width and height, of x, which must be a port or a file descriptor.

int: TCSANOW

int: TCSADRAIN

int: TCSAFLUSH