# (chibi stty)

A high-level interface to stty and ioctl.

#### `(stty . args)`

##### `(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` `setting`s 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.

#### `(term-attrs? obj)
(make-term-attrs)`

#### `(winsize? obj)
(make-winsize ws_row ws_col)
(winsize-row winsize)
(winsize-col winsize)`

#### `int: TCSANOW`

#### `int: TCSADRAIN`

#### `int: TCSAFLUSH`