mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
config: add text-blink
option to opt out of text blinking
This commit is contained in:
@ -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
|
||||
|
@ -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});
|
||||
|
Reference in New Issue
Block a user