diff --git a/src/config/Config.zig b/src/config/Config.zig index 1f9a78f31..59fa35f35 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -346,6 +346,13 @@ foreground: Color = .{ .r = 0xFF, .g = 0xFF, .b = 0xFF }, /// This value does not apply to Emoji or images. @"minimum-contrast": f64 = 1, +/// Whether to enable blinking text. +/// Text can be made to blink via a SGR sequence, which is synchronized with +/// cursor blinking when that is enabled. Text blinking and cursor blinking +/// can be independently toggled on or off without interfering with each other: +/// to adjust cursor blinking settings, see `cursor-style-blink`. +@"text-blink": bool = true, + /// Color palette for the 256 color form that many terminal applications use. /// The syntax of this configuration is `N=HEXCODE` where `N` is 0 to 255 (for /// the 256 colors in the terminal color table) and `HEXCODE` is a typical RGB diff --git a/src/renderer/Thread.zig b/src/renderer/Thread.zig index a3ce8fc4c..1b1f33c7d 100644 --- a/src/renderer/Thread.zig +++ b/src/renderer/Thread.zig @@ -93,7 +93,7 @@ flags: packed struct { /// This is true when blinking text should be visible and false /// when it should not be visible. This is toggled on a timer by the /// thread automatically. - blink_visible: bool = false, + blink_visible: bool = true, /// Whether the cursor should be forced into staying visible regardless /// of blinking. Used when the user is typing. @@ -109,10 +109,12 @@ flags: packed struct { pub const DerivedConfig = struct { custom_shader_animation: configpkg.CustomShaderAnimation, + text_blink: bool, pub fn init(config: *const configpkg.Config) DerivedConfig { return .{ .custom_shader_animation = config.@"custom-shader-animation", + .text_blink = config.@"text-blink", }; } }; @@ -547,7 +549,7 @@ fn renderCallback( t.renderer.updateFrame( t.surface, t.state, - t.flags.blink_visible, + !t.config.text_blink or t.flags.blink_visible, t.flags.cursor_always_visible or t.flags.blink_visible, ) catch |err| log.warn("error rendering err={}", .{err});