WinTty

WinTty impleements the Tty using the VT input mode and the Win32 ReadConsoleInput and WriteConsole APIs. We use this instead of ReadFile/WriteFile in order to obtain resize events, and access to the screen size. The terminal is expected to be connected the the process' STD_INPUT_HANDLE and STD_OUTPUT_HANDLE.

Constructors

this
this()

Default constructor. This expects the terminal to be connected to STD_INPUT_HANDLE and STD_OUTPUT_HANDLE.

Members

Functions

close
void close()
Undocumented in source. Be warned that the author may not have intended to support it.
flush
void flush()
Undocumented in source. Be warned that the author may not have intended to support it.
raw
void raw()
Undocumented in source. Be warned that the author may not have intended to support it.
read
string read(Duration dur)
Undocumented in source. Be warned that the author may not have intended to support it.
resized
bool resized()
Undocumented in source. Be warned that the author may not have intended to support it.
restore
void restore()
Undocumented in source. Be warned that the author may not have intended to support it.
save
void save()
Undocumented in source. Be warned that the author may not have intended to support it.
start
void start()
Undocumented in source. Be warned that the author may not have intended to support it.
stop
void stop()
Undocumented in source. Be warned that the author may not have intended to support it.
wakeUp
void wakeUp()
Undocumented in source. Be warned that the author may not have intended to support it.
windowSize
Coord windowSize()
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(string s)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From Tty

save
void save()

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

restore
void restore()

Restore tty settings saved with save().

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.

write
void write(string s)

Write output.

flush
void flush()

Flush output.

windowSize
Coord windowSize()

Get window size.

stop
void stop()

Stop input scanning.

close
void close()

Close the tty device.

start
void start()

Start termio. This will open the device.

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.)

wakeUp
void wakeUp()

Wake up any reader blocked in read().

Meta