Terminal provides utilities for controlling terminal behavior
Class methods
Clear the screen and move cursor to home position
Sourceclear_entire_line(io :
IO =
STDOUT)
Sourceclear_line(io :
IO =
STDOUT)
Clear from cursor to end of line
Sourceclear_to_end(io :
IO =
STDOUT)
Clear from cursor to end of screen
Sourcedisable_bracketed_paste(io :
IO =
STDOUT)
Disable bracketed paste mode
Sourcedisable_focus_reporting(io :
IO =
STDOUT)
Sourceenable_bracketed_paste(io :
IO =
STDOUT)
Enable bracketed paste mode
Sourceenable_focus_reporting(io :
IO =
STDOUT)
Sourceenter_alt_screen(io :
IO =
STDOUT)
Enter alternate screen mode
Sourceexit_alt_screen(io :
IO =
STDOUT)
Exit alternate screen mode
SourceMove cursor to home position (top-left)
Sourcemove_left(n :
Int32 = 1, io :
IO =
STDOUT)
Move cursor left n columns
Sourcemove_right(n :
Int32 = 1, io :
IO =
STDOUT)
Move cursor right n columns
SourceMove cursor to specific position (1-based row, col)
SourceEnable raw mode on an IO (typically STDIN)
Returns a block that can be used to restore the original mode
Typically you should use the block form: raw(io) { ... }
Sourcerelease_terminal(io :
IO =
STDOUT)
Release terminal (restore original state)
Sourcerestore_terminal(io :
IO =
STDOUT)
Restore terminal to program state
Sourcesave_state(io :
IO =
STDOUT)
Save terminal state (cursor position, attributes, etc.)
Sourceset_window_title(io :
IO, title :
String)
Set the terminal window title
Sourcesize
Get terminal size using ioctl
SourceCheck if IO supports raw mode
SourceCheck if output is a terminal
Source