mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-07 10:26:34 +00:00
Big Cursor State Refactor
This makes a few major changes: - cursor style on terminal is single source of stylistic truth - cursor style is split between style and style request - cursor blinking is handled by the renderer thread - cursor style/visibility is no longer stored as persistent state on renderers - cursor style computation is extracted to be shared by all renderers - mode 12 "cursor_blinking" is now source of truth on whether blinking is enabled or not - CSI q and mode 12 are synced like xterm
This commit is contained in:
@@ -11,9 +11,6 @@ const renderer = @import("../renderer.zig");
|
||||
/// state (i.e. the terminal, devmode, etc. values).
|
||||
mutex: *std.Thread.Mutex,
|
||||
|
||||
/// Cursor configuration for rendering
|
||||
cursor: Cursor,
|
||||
|
||||
/// The terminal data.
|
||||
terminal: *terminal.Terminal,
|
||||
|
||||
@@ -23,17 +20,6 @@ terminal: *terminal.Terminal,
|
||||
/// a future exercise.
|
||||
preedit: ?Preedit = null,
|
||||
|
||||
pub const Cursor = struct {
|
||||
/// Current cursor style. This can be set by escape sequences. To get
|
||||
/// the default style, the config has to be referenced.
|
||||
style: terminal.CursorStyle = .default,
|
||||
|
||||
/// Whether the cursor is visible at all. This should not be used for
|
||||
/// "blink" settings, see "blink" for that. This is used to turn the
|
||||
/// cursor ON or OFF.
|
||||
visible: bool = true,
|
||||
};
|
||||
|
||||
/// The pre-edit state. See Surface.preeditCallback for more information.
|
||||
pub const Preedit = struct {
|
||||
/// The codepoint to render as preedit text. We only support single
|
||||
|
Reference in New Issue
Block a user