Config: cursor-style can bet set to block_hollow

`cursor-style` can now also be set to `block_hollow`, no other changes
in behaviour are added.
This commit is contained in:
Eduardo Dominguez
2024-08-16 15:25:44 -06:00
parent bbc7070c9e
commit 2e70ad20df
4 changed files with 4 additions and 1 deletions

View File

@ -325,6 +325,7 @@ palette: Palette = .{},
/// * `block`
/// * `bar`
/// * `underline`
/// * `block_hollow`
///
@"cursor-style": terminal.CursorStyle = .block,

View File

@ -16,6 +16,7 @@ pub const CursorStyle = enum {
return switch (style) {
.bar => .bar,
.block => .block,
.block_hollow => .block_hollow,
.underline => .underline,
};
}

View File

@ -139,7 +139,7 @@ pub const Cursor = struct {
/// The visual style of the cursor. Whether or not it blinks
/// is determined by mode 12 (modes.zig). This mode is synchronized
/// with CSI q, the same as xterm.
pub const CursorStyle = enum { bar, block, underline };
pub const CursorStyle = enum { bar, block, underline, block_hollow };
/// Saved cursor state.
pub const SavedCursor = struct {

View File

@ -208,6 +208,7 @@ pub const StreamHandler = struct {
const blink = self.terminal.modes.get(.cursor_blinking);
const style: u8 = switch (self.terminal.screen.cursor.cursor_style) {
.block => if (blink) 1 else 2,
.block_hollow => if (blink) 1 else 2,
.underline => if (blink) 3 else 4,
.bar => if (blink) 5 else 6,
};