aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/display.rs
diff options
context:
space:
mode:
authorDettorer <Dettorer@users.noreply.github.com>2020-11-24 00:11:03 +0100
committerGitHub <noreply@github.com>2020-11-23 23:11:03 +0000
commit2fd2db4afa232ebd15dbfff88160224badeaa669 (patch)
treeef0cdf3311df017da5fff4d29ce898d690980a3e /alacritty/src/display.rs
parent07cfe8bbba0851ff4989f6aaf082d72130cd0f5b (diff)
downloadr-alacritty-2fd2db4afa232ebd15dbfff88160224badeaa669.tar.gz
r-alacritty-2fd2db4afa232ebd15dbfff88160224badeaa669.tar.bz2
r-alacritty-2fd2db4afa232ebd15dbfff88160224badeaa669.zip
Add blinking cursor support
This adds support for blinking the terminal cursor. This can be controlled either using the configuration file, or using escape sequences. The supported control sequences for changing the blinking state are `CSI Ps SP q` and private mode 12.
Diffstat (limited to 'alacritty/src/display.rs')
-rw-r--r--alacritty/src/display.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/alacritty/src/display.rs b/alacritty/src/display.rs
index af21001e..451874c8 100644
--- a/alacritty/src/display.rs
+++ b/alacritty/src/display.rs
@@ -160,6 +160,9 @@ pub struct Display {
#[cfg(not(any(target_os = "macos", windows)))]
pub is_x11: bool,
+ /// UI cursor visibility for blinking.
+ pub cursor_hidden: bool,
+
renderer: QuadRenderer,
glyph_cache: GlyphCache,
meter: Meter,
@@ -300,6 +303,7 @@ impl Display {
is_x11,
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
wayland_event_queue,
+ cursor_hidden: false,
})
}
@@ -442,8 +446,9 @@ impl Display {
let viewport_match = search_state
.focused_match()
.and_then(|focused_match| terminal.grid().clamp_buffer_range_to_visible(focused_match));
+ let cursor_hidden = self.cursor_hidden || search_state.regex().is_some();
- let grid_cells = terminal.renderable_cells(config, !search_active).collect::<Vec<_>>();
+ let grid_cells = terminal.renderable_cells(config, !cursor_hidden).collect::<Vec<_>>();
let visual_bell_intensity = terminal.visual_bell.intensity();
let background_color = terminal.background_color();
let cursor_point = terminal.grid().cursor.point;