Appearance
Erase screen (ED 2)
ESC [ 2 JED 2 erases the entire visible screen. The sequence is
ESC [ 2 J. The cursor position is not changed. Does not affect the scrollback buffer — use ED 3 to clear scrollback.
ED 2 is what many users think of as 'clear screen', but it only clears the visible display. It intentionally does not erase scrollback; xterm-style ED 3 exists for that separate job. This distinction matters for security and debugging, because wiping the viewport should not silently destroy the user's history.How this is testedautomated
Write three lines, send
Write three lines, send
\x1b[2J (ED 2), verify all visible content is cleared.The same probe runs against headless backends (via Termless) and real terminal apps (via a daemon launched in each terminal). This lets us distinguish parser correctness from rendering correctness.
Analysis2026-05-17
Supported by 12 of 14 backends (86%)
Terminal Applications
| Terminal | Version | Support | Notes |
|---|---|---|---|
| iTerm2 | 3.6.9 | ✓ yes | |
| Ghostty | 1.3.1 | ✓ yes | |
| VS Code | ✓ yes | ||
| Warp | ✓ yes | ||
| Kitty | 0.46.2 | ✓ yes | |
| Cursor | ✓ yes | ||
| Terminal.app | ✓ yes |