mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
Merge pull request #270 from mitchellh/cc-hidden-inactive-cursor
Don't show hollow cursor in inactive windows when cursor is hidden.
This commit is contained in:
@ -528,22 +528,21 @@ pub fn render(
|
|||||||
state.mutex.lock();
|
state.mutex.lock();
|
||||||
defer state.mutex.unlock();
|
defer state.mutex.unlock();
|
||||||
|
|
||||||
// Setup our cursor state
|
self.cursor_visible = visible: {
|
||||||
|
// If the cursor is explicitly not visible in the state,
|
||||||
|
// then it is not visible.
|
||||||
|
if (!state.cursor.visible) break :visible false;
|
||||||
|
|
||||||
|
// If the cursor isn't a blinking style, then never blink.
|
||||||
|
if (!state.cursor.style.blinking()) break :visible true;
|
||||||
|
|
||||||
|
// Otherwise, adhere to our current state.
|
||||||
|
break :visible self.cursor_visible;
|
||||||
|
};
|
||||||
|
|
||||||
if (self.focused) {
|
if (self.focused) {
|
||||||
self.cursor_visible = visible: {
|
|
||||||
// If the cursor is explicitly not visible in the state,
|
|
||||||
// then it is not visible.
|
|
||||||
if (!state.cursor.visible) break :visible false;
|
|
||||||
|
|
||||||
// If the cursor isn't a blinking style, then never blink.
|
|
||||||
if (!state.cursor.style.blinking()) break :visible true;
|
|
||||||
|
|
||||||
// Otherwise, adhere to our current state.
|
|
||||||
break :visible self.cursor_visible;
|
|
||||||
};
|
|
||||||
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,22 +728,21 @@ pub fn render(
|
|||||||
state.mutex.lock();
|
state.mutex.lock();
|
||||||
defer state.mutex.unlock();
|
defer state.mutex.unlock();
|
||||||
|
|
||||||
// Setup our cursor state
|
self.cursor_visible = visible: {
|
||||||
|
// If the cursor is explicitly not visible in the state,
|
||||||
|
// then it is not visible.
|
||||||
|
if (!state.cursor.visible) break :visible false;
|
||||||
|
|
||||||
|
// If the cursor isn't a blinking style, then never blink.
|
||||||
|
if (!state.cursor.style.blinking()) break :visible true;
|
||||||
|
|
||||||
|
// Otherwise, adhere to our current state.
|
||||||
|
break :visible self.cursor_visible;
|
||||||
|
};
|
||||||
|
|
||||||
if (self.focused) {
|
if (self.focused) {
|
||||||
self.cursor_visible = visible: {
|
|
||||||
// If the cursor is explicitly not visible in the state,
|
|
||||||
// then it is not visible.
|
|
||||||
if (!state.cursor.visible) break :visible false;
|
|
||||||
|
|
||||||
// If the cursor isn't a blinking style, then never blink.
|
|
||||||
if (!state.cursor.style.blinking()) break :visible true;
|
|
||||||
|
|
||||||
// Otherwise, adhere to our current state.
|
|
||||||
break :visible self.cursor_visible;
|
|
||||||
};
|
|
||||||
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