mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
Don't show hollow cursor in inactive windows when cursor is hidden.
This is the behavior of the other terminals I have, such as iTerm, allcritty, WezTerm, and Kitty. The hollow cursor is especially noticable when running in two panes, one of them inactive with animations (such as a progress bar)
This commit is contained in:
@ -528,8 +528,6 @@ pub fn render(
|
|||||||
state.mutex.lock();
|
state.mutex.lock();
|
||||||
defer state.mutex.unlock();
|
defer state.mutex.unlock();
|
||||||
|
|
||||||
// Setup our cursor state
|
|
||||||
if (self.focused) {
|
|
||||||
self.cursor_visible = visible: {
|
self.cursor_visible = visible: {
|
||||||
// If the cursor is explicitly not visible in the state,
|
// If the cursor is explicitly not visible in the state,
|
||||||
// then it is not visible.
|
// then it is not visible.
|
||||||
@ -541,9 +539,10 @@ pub fn render(
|
|||||||
// Otherwise, adhere to our current state.
|
// Otherwise, adhere to our current state.
|
||||||
break :visible self.cursor_visible;
|
break :visible self.cursor_visible;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (self.focused) {
|
||||||
self.cursor_style = renderer.CursorStyle.fromTerminal(state.cursor.style) orelse .box;
|
self.cursor_style = renderer.CursorStyle.fromTerminal(state.cursor.style) orelse .box;
|
||||||
} else {
|
} else {
|
||||||
self.cursor_visible = true;
|
|
||||||
self.cursor_style = .box_hollow;
|
self.cursor_style = .box_hollow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -728,8 +728,6 @@ pub fn render(
|
|||||||
state.mutex.lock();
|
state.mutex.lock();
|
||||||
defer state.mutex.unlock();
|
defer state.mutex.unlock();
|
||||||
|
|
||||||
// Setup our cursor state
|
|
||||||
if (self.focused) {
|
|
||||||
self.cursor_visible = visible: {
|
self.cursor_visible = visible: {
|
||||||
// If the cursor is explicitly not visible in the state,
|
// If the cursor is explicitly not visible in the state,
|
||||||
// then it is not visible.
|
// then it is not visible.
|
||||||
@ -741,9 +739,10 @@ pub fn render(
|
|||||||
// Otherwise, adhere to our current state.
|
// Otherwise, adhere to our current state.
|
||||||
break :visible self.cursor_visible;
|
break :visible self.cursor_visible;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (self.focused) {
|
||||||
self.cursor_style = renderer.CursorStyle.fromTerminal(state.cursor.style) orelse .box;
|
self.cursor_style = renderer.CursorStyle.fromTerminal(state.cursor.style) orelse .box;
|
||||||
} else {
|
} else {
|
||||||
self.cursor_visible = true;
|
|
||||||
self.cursor_style = .box_hollow;
|
self.cursor_style = .box_hollow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user