vt: honour synchronized output (DECSET 2026) with a present timeout

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I173dc842d89d96ea39154e1fde95be816a6a6964
This commit is contained in:
raf 2026-06-25 08:36:32 +03:00
commit 72044c21fd
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF
3 changed files with 64 additions and 2 deletions

View file

@ -151,6 +151,9 @@ pub struct Grid {
selection: Option<(Point, Point)>,
/// Bracketed paste mode (DECSET 2004): wrap pasted text in `ESC[200~`/`201~`.
bracketed_paste: bool,
/// Synchronized output (DECSET 2026): hold presentation while a frame is
/// being assembled, so the screen never shows a half-drawn update.
sync: bool,
}
fn default_tabs(cols: usize) -> Vec<bool> {
@ -185,6 +188,7 @@ impl Grid {
app_cursor: false,
selection: None,
bracketed_paste: false,
sync: false,
}
}
@ -882,6 +886,14 @@ impl Grid {
self.bracketed_paste
}
pub fn set_sync(&mut self, on: bool) {
self.sync = on;
}
pub fn sync_active(&self) -> bool {
self.sync
}
// --- inspection (logging + tests) ---
/// The visible text of one row, trailing blanks trimmed.