mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Minor changes, mainly commenting to clarify some behaviors
This commit is contained in:
@ -139,7 +139,18 @@ pub const Cursor = struct {
|
|||||||
/// The visual style of the cursor. Whether or not it blinks
|
/// The visual style of the cursor. Whether or not it blinks
|
||||||
/// is determined by mode 12 (modes.zig). This mode is synchronized
|
/// is determined by mode 12 (modes.zig). This mode is synchronized
|
||||||
/// with CSI q, the same as xterm.
|
/// with CSI q, the same as xterm.
|
||||||
pub const CursorStyle = enum { bar, block, underline, block_hollow };
|
pub const CursorStyle = enum {
|
||||||
|
bar, // DECSCUSR 5, 6
|
||||||
|
block, // DECSCUSR 1, 2
|
||||||
|
underline, // DECSCUSR 3, 4
|
||||||
|
|
||||||
|
/// The cursor styles below aren't known by DESCUSR and are custom
|
||||||
|
/// implemented in Ghostty. They are reported as some standard style
|
||||||
|
/// if requested, though.
|
||||||
|
/// Hollow block cursor. This is a block cursor with the center empty.
|
||||||
|
/// Reported as DECSCUSR 1 or 2 (block).
|
||||||
|
block_hollow,
|
||||||
|
};
|
||||||
|
|
||||||
/// Saved cursor state.
|
/// Saved cursor state.
|
||||||
pub const SavedCursor = struct {
|
pub const SavedCursor = struct {
|
||||||
|
@ -208,9 +208,12 @@ pub const StreamHandler = struct {
|
|||||||
const blink = self.terminal.modes.get(.cursor_blinking);
|
const blink = self.terminal.modes.get(.cursor_blinking);
|
||||||
const style: u8 = switch (self.terminal.screen.cursor.cursor_style) {
|
const style: u8 = switch (self.terminal.screen.cursor.cursor_style) {
|
||||||
.block => if (blink) 1 else 2,
|
.block => if (blink) 1 else 2,
|
||||||
.block_hollow => if (blink) 1 else 2,
|
|
||||||
.underline => if (blink) 3 else 4,
|
.underline => if (blink) 3 else 4,
|
||||||
.bar => if (blink) 5 else 6,
|
.bar => if (blink) 5 else 6,
|
||||||
|
|
||||||
|
// Below here, the cursor styles aren't represented by
|
||||||
|
// DECSCUSR so we map it to some other style.
|
||||||
|
.block_hollow => if (blink) 1 else 2,
|
||||||
};
|
};
|
||||||
try writer.print("{d} q", .{style});
|
try writer.print("{d} q", .{style});
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user