1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 11:17:15 +03:00

Fixed invisible I-beam/underline cursor w/force_reverse_video_cursor

closes: https://github.com/wez/wezterm/issues/1076
This commit is contained in:
Wez Furlong 2021-09-04 14:24:58 -07:00
parent 4c8ccf8efc
commit fea3a527dd
2 changed files with 12 additions and 18 deletions

View File

@ -30,6 +30,7 @@ As features stabilize some brief notes about them will accumulate here.
* Fixed: Crash due to Out of Memory condition when the iTerm2 protocol was used to send excessively large PNG files [#1031](https://github.com/wez/wezterm/issues/1031)
* Fixed: `DCH` sequence would remove cells and replace them with default-blank cells instead of blank-cells-with-current-bg-color. [#789](https://github.com/wez/wezterm/issues/789)
* New: Added [Multiple](config/lua/keyassignment/Multiple.md) key assignment action for combining multuple actions in a single press.
* Fixed: invisible I-beam or underline cursor when `force_reverse_video_cursor = true` [#1076](https://github.com/wez/wezterm/issues/1076)
### 20210814-124438-54e29167

View File

@ -1093,12 +1093,7 @@ impl super::TermWindow {
.texture_coords(),
);
let color = if self.config.force_reverse_video_cursor {
bg_color
} else {
params.cursor_border_color
};
quad.set_fg_color(color);
quad.set_fg_color(params.cursor_border_color);
}
let images = cluster.attrs.images().unwrap_or_else(|| vec![]);
@ -1305,11 +1300,7 @@ impl super::TermWindow {
.cursor_sprite(cursor_shape)?
.texture_coords(),
);
quad.set_fg_color(if self.config.force_reverse_video_cursor {
bg_color
} else {
params.cursor_border_color
});
quad.set_fg_color(params.cursor_border_color);
}
}
}
@ -1515,12 +1506,9 @@ impl super::TermWindow {
(params.cursor.shape, CursorVisibility::Hidden)
};
let (fg_color, bg_color) = match (
selected,
self.focused.is_some() && params.is_active_pane,
cursor_shape,
visibility,
) {
let focused_and_active = self.focused.is_some() && params.is_active_pane;
let (fg_color, bg_color) = match (selected, focused_and_active, cursor_shape, visibility) {
// Selected text overrides colors
(true, _, _, CursorVisibility::Hidden) => (params.selection_fg, params.selection_bg),
// Cursor cell overrides colors
@ -1540,7 +1528,12 @@ impl super::TermWindow {
fg_color,
bg_color,
cursor_shape: if visibility == CursorVisibility::Visible {
Some(cursor_shape)
match cursor_shape {
CursorShape::BlinkingBlock | CursorShape::SteadyBlock if focused_and_active => {
None
}
shape => Some(shape),
}
} else {
None
},