diff options
| author | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | 2023-09-09 20:17:55 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | 2023-09-09 20:19:37 -0700 |
| commit | d9cfd00e9fc77d123fc20fa51fa9554af31c09d3 (patch) | |
| tree | a24133dbe2a2dbff01a683b8cf1ad93951d45782 /src/config.zig | |
| parent | 7fd8dde933e408358a79f2179772d686ddd6893e (diff) | |
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
Diffstat (limited to 'src/config.zig')
| -rw-r--r-- | src/config.zig | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/config.zig b/src/config.zig index 9e582305d..cc90a3c28 100644 --- a/src/config.zig +++ b/src/config.zig @@ -106,7 +106,7 @@ pub const Config = struct { /// In order to fix it, we probably would want to add something similar to Kitty's /// shell integration options (no-cursor). For more information see: /// https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.shell_integration - @"cursor-style": CursorStyle = .bar, + @"cursor-style": terminal.Cursor.Style = .bar, /// Whether the cursor shall blink @"cursor-style-blink": bool = true, @@ -1475,22 +1475,6 @@ pub const ShellIntegration = enum { zsh, }; -/// Available options for `cursor-style`. Blinking is configured with -/// the `cursor-style-blink` option. -pub const CursorStyle = enum { - bar, - block, - underline, - - pub fn toTerminalCursorStyle(self: CursorStyle, blinks: bool) terminal.CursorStyle { - return switch (self) { - .bar => if (blinks) .blinking_bar else .steady_bar, - .block => if (blinks) .blinking_block else .steady_block, - .underline => if (blinks) .blinking_underline else .steady_underline, - }; - } -}; - // Wasm API. pub const Wasm = if (!builtin.target.isWasm()) struct {} else struct { const wasm = @import("os/wasm.zig"); |
