feat(core): Osc133Scanner + FallbackScanner status detectors + grid tail_text

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-09 22:59:24 +07:00
parent 84a19356e2
commit 4ec7dc1a78
3 changed files with 198 additions and 0 deletions
+17
View File
@@ -59,6 +59,23 @@ impl GridSurface {
pub fn term(&self) -> &Term<VoidListener> {
&self.term
}
/// The visible grid as text — the last `lines` rows, trailing blanks trimmed.
/// Used by the fallback detector.
pub fn tail_text(&self, lines: usize) -> String {
let size = self.size();
let start = size.lines.saturating_sub(lines);
let mut out = String::new();
for line in start..size.lines {
let mut row = String::new();
for col in 0..size.cols {
row.push(self.char_at(line, col));
}
out.push_str(row.trim_end());
out.push('\n');
}
out
}
}
#[cfg(test)]