Tty

Tty 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

close
void close()

Close the tty device.

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(Duration dur)

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. This is edge triggered (reading it will clear the value.)

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.

wakeUp
void wakeUp()

Wake up any reader blocked in read().

windowSize
Coord windowSize()

Get window size.

write
void write(string s)

Write output.

Meta