cbreak
- Put the terminal into cbreak mode.cooked
- Put the terminal into cooked mode.echo
- Change the echo mode of the terminal.preserve
- Run a block of code, restoring the terminal state when the block ends.raw
- Put the terminal into raw mode.size
- Returns the size of the terminal, as (columns, rows)
.cbreak
fn cbreak() -> int
Put the terminal into cbreak mode.
This is the normal unbuffered mode.
cooked
fn cooked() -> int
Put the terminal into cooked mode.
This is the normal line-buffered mode.
echo
fn echo(enable: bool) -> int
Change the echo mode of the terminal.
true
turns echo on, and false
turns echo off.
preserve
fn preserve<T>(body: &fn() -> T) -> T
Run a block of code, restoring the terminal state when the block ends.
This will ensure you don't leave the terminal in a broken state, even if the current task fails.
raw
fn raw() -> int
Put the terminal into raw mode.
This is like cbreak mode, except that control characters (like ^C) are not translated into signals.
size
fn size() -> (uint, uint)
Returns the size of the terminal, as (columns, rows)
.