pub enum Mode {
Charred,
Cooked,
Rare,
Raw,
}
Expand description
A terminal mode.
Currently four terminal modes are supported:
-
Charred mode considers the terminal configuration as too hot to touch and makes no changes.
-
Cooked mode is the usual mode of operation on Unix and includes several features that go beyond character-based I/O, including editing the input line by line, turning key presses such as control-c into signals, and translating line endings.
On Windows, this mode optimizes for interoperability, enables the UTF-8 code page for input and output, while also activating
ENABLE_VIRTUAL_TERMINAL_INPUT
,ENABLE_PROCESSED_OUTPUT
, andENABLE_VIRTUAL_TERMINAL_PROCESSING
. -
Rare mode, also called cbreak mode, disables the line editor but leaves other terminal convenience features such as processing control-c enabled. This is the default mode for prettytty.
-
Raw mode disables all features beyond character-based I/O and ANSI escape sequences. It maximizes the application’s control over input and output, but it also places the burden of implementing features at least as good as line editing on the application developer.
Variants§
Charred
Charred mode doesn’t dare to touch the terminal configuration; it’s too hot.
Cooked
Cooked mode means turning control-c/d into signals, fiddling with line-endings in the output, and always editing the input line by line. Still, it allows for ANSI escape sequences.
Rare
Rare or cbreak mode.
Raw
Raw mode.