From e7c38ab37f967d16e2eacdb0bbde2d933a332057 Mon Sep 17 00:00:00 2001 From: akbash Date: Sun, 9 Aug 2026 14:50:11 +0300 Subject: perf(ui): avoid full pane mode reads for scrollbars (#2554) --- src/pane/terminal.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/pane') diff --git a/src/pane/terminal.rs b/src/pane/terminal.rs index a6e5c1da..1c10726c 100644 --- a/src/pane/terminal.rs +++ b/src/pane/terminal.rs @@ -388,6 +388,10 @@ impl PaneTerminal { self.ghostty.input_state() } + pub fn alternate_screen_active(&self) -> bool { + self.ghostty.alternate_screen_active() + } + pub fn wheel_routing(&self) -> Option { self.ghostty.wheel_routing() } @@ -1665,6 +1669,12 @@ impl GhosttyPaneTerminal { core.kitty_keyboard.replay_ansi() } + pub fn alternate_screen_active(&self) -> bool { + self.core.lock().is_ok_and(|core| { + core.terminal.active_screen().ok() == Some(crate::ghostty::ActiveScreen::Alternate) + }) + } + pub fn input_state(&self) -> Option { let Ok(core) = self.core.lock() else { return None; -- cgit v1.2.3