Appearance
Enter alt screen (DECSET 1049)
DECSET 1049 switches to the alternate screen buffer and saves the cursor position. The sequence is
ESC [ ? 1049 h. The alternate screen is a separate buffer used by full-screen TUI applications (vim, less, htop, tmux) so they can render without disturbing the user's scrollback history.
When the application exits and sends DECRST 1049, the terminal restores the original buffer contents and cursor position — the user's previous shell output reappears as if the TUI never ran. This is why closing vim brings back the terminal content that was there before.
Mode 1049 combines three operations: save cursor (DECSC), switch to alt screen (?47), and clear the alt screen. Universally supported in modern terminals.Supported by 6 of 6 backends (100%)
Support Matrix
| Backend | Version | Support | Notes |
|---|---|---|---|
| Alacritty | 0.26.0 | ✓ yes | |
| Ghostty | 1.3.1 | ✓ yes | |
| Kitty | 0.40.0 | ✓ yes | |
| vt100 | 0.1.0 | ✓ yes | |
| WezTerm | 0.1.0-fork.5 | ✓ yes | |
| xterm.js | 5.5.0 | ✓ yes |