pub enum CursorStyle {
Default,
BlinkingBlock,
SteadyBlock,
BlinkingUnderline,
SteadyUnderline,
BlinkingBar,
SteadyBar,
}Expand description
Cursor style values for DECSCUSR (ESC [ Ps SP q).
The variants map directly to the numeric Ps parameter used by
write_cursor_style.
Variants§
Default
Terminal default, DECSCUSR parameter 0.
Writing this asks the terminal for the cursor its user configured.
kitty, foot, rio, Alacritty, VTE, Konsole and Windows Terminal all
read the shape back from configuration here, so it is the way to
hand the cursor back at the end of a session. xterm documents 0 as
a blinking block instead, which matches none of them.
What it draws is therefore not knowable from the parameter: it is
whatever that user chose, and terminals do not even agree on the
blink, with kitty and Windows Terminal forcing it on where the
others restore it from configuration too. So this names no shape and
no blink state, and shape and
blinking answer None for it. Ask with
Program::request_cursor_style
when you need to know what the cursor actually is.
BlinkingBlock
Blinking block cursor, DECSCUSR parameter 1.
SteadyBlock
Steady block cursor, DECSCUSR parameter 2.
BlinkingUnderline
Blinking underline cursor, DECSCUSR parameter 3.
SteadyUnderline
Steady underline cursor, DECSCUSR parameter 4.
BlinkingBar
Blinking bar cursor, DECSCUSR parameter 5.
SteadyBar
Steady bar cursor, DECSCUSR parameter 6.
Implementations§
Source§impl CursorStyle
impl CursorStyle
Sourcepub fn from_param(n: u32) -> Option<Self>
pub fn from_param(n: u32) -> Option<Self>
The style a DECSCUSR parameter selects.
§Returns
None for a parameter outside 0..=6, which selects no style this
library knows. Used to read the style back out of a DECRPSS reply.
Sourcepub fn new(shape: CursorShape, blinking: bool) -> Self
pub fn new(shape: CursorShape, blinking: bool) -> Self
The style that draws shape, blinking or steady.
Sourcepub fn shape(self) -> Option<CursorShape>
pub fn shape(self) -> Option<CursorShape>
The shape this style draws.
§Returns
None for CursorStyle::Default, which defers to the terminal
rather than naming a shape.
Trait Implementations§
Source§impl Clone for CursorStyle
impl Clone for CursorStyle
Source§fn clone(&self) -> CursorStyle
fn clone(&self) -> CursorStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more