kClearScreen top-level constant
String
const kClearScreen
The screen clear a child writes when it redraws from the top.
revali dev writes it from _wipeOrDivide — print('\x1B[2J\x1B[0;0H'),
vm_service_handler.dart — on a reload and when the user presses c.
Unlike every other non-SGR sequence here it is read rather than dropped:
ServiceSession.ingest turns it into a kRedrawDivider, so a reader can
see where the child started its screen over. It is not obeyed — see that
constant for why a pane with scrollback must not empty itself on it.
The cursor-home that follows it (ESC[0;0H) keeps being dropped, and
should: a pane owns a region it redraws top-down and never addresses a
cursor inside, so there is no position for it to mean anything about.
Implementation
const kClearScreen = '\x1B[2J';