TtyImpl

TtyImpl is the interface that implementations should override or supply to support terminal I/O ioctls or equivalent functionality. It is provided in this form, as some implementations may not be based on actual tty devices.

Members

Functions

blocking
void blocking(bool b)

Make input blocking or non-blocking. Blocking input will cause reads against the terminal to block forever until at least one character is returned. Otherwise it will return in at most

flush
void flush()

Flush output.

raw
void raw()

Make the terminal suitable for raw mode input. In this mode the terminal is not suitable for typical interactive shell use, but is good if absolute control over input is needed. After this, reads will block until one character is presented. (Same effect as 'blocking(true)'.

read
string read()

Read input. May return an empty slice if no data is present and blocking is disabled.

resized
bool resized()

Resized returns true if the window was resized since last checked. Normally resize will force the window into non-blocking mode so that the caller can see the resize in a timely fashion.

restore
void restore()

Restore tty settings saved with save().

save
void save()

Save current tty settings. These can be subsequently restored using restore.

start
void start()

Start termio. This will open the device.

stop
void stop()

Stop input scanning. This may close the tty device.

windowSize
Coord windowSize()

Get window size.

write
void write(string s)

Write output.

Meta