the runtime your coding agents live on
Rust agentagent-orchestrationaiai-agentsclaude-codeclicodexcoding-agentsdeveloper-toolsdevtoolsmultiplexerrustterminalterminal-multiplexerterminal-uitmuxtuiworkspace-manager
perf(ui): avoid full pane mode reads for scrollbars (#2554)
akbashe7c38ab37f96
diff --git a/src/pane.rs b/src/pane.rsindex da99f55ed..b2c01f016 100644--- a/src/pane.rs+++ b/src/pane.rs@@ -2596,6 +2596,10 @@ impl PaneRuntime {self.terminal.input_state()}+ pub fn alternate_screen_active(&self) -> bool {+ self.terminal.alternate_screen_active()+ }+pub fn cursor_state(&self, area: Rect, show_cursor: bool) -> Option<TerminalCursorState> {if !show_cursor {return None;diff --git a/src/pane/terminal.rs b/src/pane/terminal.rsindex a6e5c1da8..1c10726c1 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<crate::pane::WheelRouting> {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<InputState> {let Ok(core) = self.core.lock() else {return None;diff --git a/src/terminal/runtime.rs b/src/terminal/runtime.rsindex 13e296909..d3900b68c 100644--- a/src/terminal/runtime.rs+++ b/src/terminal/runtime.rs@@ -315,6 +315,10 @@ impl TerminalRuntime {self.0.input_state()}+ pub fn alternate_screen_active(&self) -> bool {+ self.0.alternate_screen_active()+ }+pub fn cursor_state(&self,area: Rect,diff --git a/src/ui/panes.rs b/src/ui/panes.rsindex df9813cf3..cce8ab02b 100644--- a/src/ui/panes.rs+++ b/src/ui/panes.rs@@ -32,10 +32,7 @@ fn pane_border_title(label: &str, pane_width: u16, _focused: bool) -> Option<Str}fn terminal_inner_rect(rt: &TerminalRuntime, pane_inner: Rect, pane_scrollbars: bool) -> Rect {- if !pane_scrollbars- || pane_inner.width <= 4- || rt.input_state().is_some_and(|state| state.alternate_screen)- {+ if !pane_scrollbars || pane_inner.width <= 4 || rt.alternate_screen_active() {return pane_inner;}