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:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user