diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-08-09 20:36:11 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-08-09 20:36:11 +0300 |
| commit | e2aa86a9e8b6445488ef11b2c0a8b4c22a6f79ce (patch) | |
| tree | ea3ea433fca073ae8e0636f42a4c4bf03ea87777 /src/pane.rs | |
| parent | 4e31084495120674a0cf403a27d3d91c5efb34fe (diff) | |
test: guard pane-scaled render performance
refs #2550
Diffstat (limited to 'src/pane.rs')
| -rw-r--r-- | src/pane.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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<usize> = 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<InputState> { + #[cfg(test)] + AGGREGATE_INPUT_STATE_READS.set(AGGREGATE_INPUT_STATE_READS.get() + 1); self.terminal.input_state() } |
