didOutputLines method
Clears the console, preserving ephemeral text.
Implementation
void didOutputLines(int count) {
if (depth > 0) return;
final existing = switch (lines[depth]) {
int existing => existing,
_ => 0,
};
lines[depth] = existing + count;
}