From e2aa86a9e8b6445488ef11b2c0a8b4c22a6f79ce Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 9 Aug 2026 20:36:11 +0300 Subject: test: guard pane-scaled render performance refs #2550 --- src/pane.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/pane.rs') diff --git a/src/pane.rs b/src/pane.rs index b2c01f01..130c75e5 100644 --- a/src/pane.rs +++ b/src/pane.rs @@ -54,6 +54,21 @@ const RELEASE_REACQUIRE_SUPPRESSION: std::time::Duration = std::time::Duration:: const PANE_TERM: &str = "xterm-256color"; const PANE_COLORTERM: &str = "truecolor"; +#[cfg(test)] +thread_local! { + static AGGREGATE_INPUT_STATE_READS: Cell = const { Cell::new(0) }; +} + +#[cfg(test)] +pub(crate) fn reset_aggregate_input_state_reads() { + AGGREGATE_INPUT_STATE_READS.set(0); +} + +#[cfg(test)] +pub(crate) fn aggregate_input_state_reads() -> usize { + AGGREGATE_INPUT_STATE_READS.get() +} + fn apply_pane_terminal_env(cmd: &mut CommandBuilder) { // Each pane is rendered by herdr's own terminal layer, not the outer terminal // that launched the app. Advertising the inherited TERM leaks the host terminal @@ -2593,6 +2608,8 @@ impl PaneRuntime { } pub fn input_state(&self) -> Option { + #[cfg(test)] + AGGREGATE_INPUT_STATE_READS.set(AGGREGATE_INPUT_STATE_READS.get() + 1); self.terminal.input_state() } -- cgit v1.2.3