summaryrefslogtreecommitdiff
path: root/src/terminal/runtime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/terminal/runtime.rs')
-rw-r--r--src/terminal/runtime.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/terminal/runtime.rs b/src/terminal/runtime.rs
index 156d18fd..619c98a4 100644
--- a/src/terminal/runtime.rs
+++ b/src/terminal/runtime.rs
@@ -468,6 +468,27 @@ impl TerminalRuntime {
Some((screen, crate::terminal::ScreenSnapshot { cols, rows }))
}
+ pub(crate) fn screen_text_snapshot_with_seq(
+ &self,
+ ) -> Option<(
+ crate::ghostty::ActiveScreen,
+ crate::terminal::ScreenSnapshot,
+ u64,
+ )> {
+ for _ in 0..3 {
+ let before = self.content_seq();
+ if !before.is_multiple_of(2) {
+ continue;
+ }
+ let (screen, snapshot) = self.screen_text_snapshot()?;
+ let after = self.content_seq();
+ if before == after {
+ return Some((screen, snapshot, after));
+ }
+ }
+ None
+ }
+
pub fn encode_mouse_button(
&self,
kind: crossterm::event::MouseEventKind,
@@ -525,6 +546,10 @@ impl TerminalRuntime {
pub(crate) fn current_size(&self) -> (u16, u16) {
self.0.current_size()
}
+
+ pub(crate) fn content_seq(&self) -> u64 {
+ self.0.content_seq()
+ }
}
#[cfg(test)]