GNU screen — ANSI escape code support
GNU screen is the original terminal multiplexer — first released by Oliver Laumann at the Berlin Technical University in 1987, BSD-licensed since 1989, in the GNU project since 1995. It predates tmux by 20 years and still ships in every major distro plus macOS's /usr/bin/screen. The canonical multiplexer terminfo entry screen-256color (and the older screen) is named after it; every modern multiplexer including tmux historically aliased to screen-256color for compatibility.
For ANSI escape codes the picture in 2026 is rougher than tmux because the upstream release cadence is glacial: screen 4.x lasted from 2003 to 2024, screen 5.0.0 (April 2024) was the first release in 21 years to add 24-bit truecolor parsing, and Apple's /usr/bin/screen on macOS Sonoma still ships v4.00.03 from 2006 — silently downgrading every \x1b[38;2;…m sequence to the nearest 16-colour index. OSC 8 hyperlinks, styled underlines (SGR 4:3–4:5), strikethrough (SGR 9), focus events, sixel and Kitty graphics are all stripped by screen 5.0 — they never reach the outer terminal. If you need a modern multiplexer in 2026, choose tmux; choose screen only when the host can't install anything new (legacy servers, restricted base images) or you specifically want screen's screenrc ecosystem.
Last updated
Feature support
How this terminal scores against the 15 features tracked in the site-wide support matrix. Click any feature name to see the full row across every terminal.
- 8 basic colors (30–37 / 40–47)SGR 30–37 foreground, 40–47 background.yes
- Bright (aixterm) colors (90–97 / 100–107)aixterm SGR extension.yes
- 256-color palette (38;5;n / 48;5;n)xterm 256-color extension.partial
- 24-bit truecolor (38;2;r;g;b)16.7M direct RGB. Set $COLORTERM=truecolor.partial
- Italic (SGR 3)Italic text attribute.partial
- Styled underlines (4:1–4:5)Curly/dotted/dashed underline styles.no
- Strikethrough (SGR 9)Horizontal line through text.no
- OSC 8 hyperlinksInline clickable URIs.no
- Alt screen (?1049h)Full-screen app buffer.yes
- Mouse tracking (SGR ?1006)Mouse click/drag events.partial
- Bracketed paste (?2004)Pasted text wrapped in ESC[200~/ESC[201~.partial
- Focus events (?1004)ESC[I on focus in, ESC[O on focus out.no
- Sixel graphicsDEC sixel inline raster images.no
- Kitty graphics protocolPNG/RGB inline images, animations.no
- Synchronized output (?2026)Atomic frame updates to avoid tearing.no
Sequences that work here
Canonical reference pages for the escape sequences this terminal handles cleanly. Each links to a full page with byte forms, citations, and per-language examples.
- SGR 38;2;R;G;B — 24-bit truecolor foreground
\x1b[38;2;R;G;BmPick any of 16,777,216 foreground RGB colors directly.
- DECSET 1049 — Alternate screen buffer
\x1b[?1049h (enter) \x1b[?1049l (leave)Switch to a separate screen buffer (like vim/less do on launch).
- SGR 38;5;n — 256-color foreground
\x1b[38;5;NmPick a foreground color from the 256-color xterm palette.
- CUP — Set cursor position
\x1b[row;colHMove the cursor to absolute row/column (1-indexed).
- ED — Erase in display (\x1b[2J clear screen)
\x1b[NJErase part or all of the screen.
Quirks & version notes
Per-terminal caveats you'll want to know before relying on a sequence in production.
- Truecolor only since screen 5.0 (April 2024) — and not on macOS
- GNU screen 5.0.0 was the first release in 21 years to add a parser for
\x1b[38;2;r;g;b mand\x1b[48;2;r;g;b m. Any older release (Ubuntu 22.04 LTS ships 4.09.00, Debian Bookworm ships 4.09.00, every existing macOS ships 4.00.03 from 2006) silently quantises truecolor SGR to the nearest 16-colour value — there is noTc/RGBcapability flag you can flip to make it work. To detect:screen --version(need5.0.0or later) andinfocmp screen-256color | grep RGB. The portable workaround is to emit 256-indexed colour as the lowest-common-denominator inside any screen session you don't control the version of. - OSC 8 hyperlinks, styled underlines, strikethrough — all stripped
- Screen's escape-sequence parser is hand-coded against the original VT100/VT220 manual plus a small set of post-1987 extensions. Anything newer than that — OSC 8 (2017), SGR 4:3/4:4/4:5 styled underlines (xterm 341, 2018), SGR 9 strikethrough — is not recognised; the offending bytes are dropped before they reach the outer terminal, but the visible payload text (the link's anchor, the underlined / struck-through word) is still printed unstyled. There is no passthrough mode — unlike tmux 3.3+'s
allow-passthrough on, GNU screen never forwards unrecognised escape sequences. If your application needs any of these features inside a multiplexer, use tmux. - $TERM=screen-256color and the terminfo crawl
- When screen launches a shell, it sets
$TERM=screen-256colorby default (orscreenon older systems whose terminfo database doesn't include the 256-colour entry —infocmp screen-256colorwill fail in that case and you'll need ncurses ≥ 5.0). The entry advertises 256 colours, italic (since ncurses 6.0; absent before), but never advertisesRGB/Tctruecolor and never advertisesSmulxstyled-underline. Override per-shell withTERM=screen-256color; override per-screenrc withterm screen-256color. Cross-multiplexer applications that need to detect "running inside any multiplexer" should check$STY(set by screen) or$TMUX(set by tmux), not$TERM(which can mislead — every emulator under the sun aliases toscreen-256colorfor compatibility reasons). - macOS /usr/bin/screen is from 2006 — use Homebrew screen for anything modern
- Apple has not updated
/usr/bin/screensince macOS 10.5 Leopard. As of macOS Sonoma / Sequoia in 2026,screen --versionreportsScreen version 4.00.03 (FAU) 23-Oct-06. This pre-dates the 256-colour entry shipping in ncurses, pre-dates UTF-8 support being a default, and obviously pre-dates the 2024 truecolor release. Install Homebrew'sbrew install screento get the current 5.0.x, then either replace/usr/bin/screenin$PATHwith/opt/homebrew/bin/screenor alias it. If you do not switch, you also losescreen-256coloritalic — applications using terminfoitaliccapability will silently fall back to plain text. - Bracketed paste, focus events, sixel — none of them
- DEC private modes ?2004 (bracketed paste), ?1004 (focus events), and the DCS sixel envelope are all parsed-and-ignored by screen. Pasting a multi-line shell prompt into screen still triggers Bash autocompletion / multi-line replay because there is no
\x1b[200~/\x1b[201~framing; editors that rely on focus events to autosave never receive them; sixel images print as garbled C1 bytes. Unlike OSC 8, these have never been on the screen project's roadmap — they're either too niche (focus events) or fundamentally incompatible with screen's character-grid model (sixel). The conservative emit strategy when you know the host is screen: skip these features and degrade gracefully. - Detach / reattach preserves the inner state — including SGR
- When you detach a screen session with Ctrl-A d and reattach later (possibly from a different SSH session, possibly to a different outer terminal entirely), screen replays its persisted character-grid + SGR state to the new outer terminal. This works because screen stores the rendered grid, not the original byte stream — so if you emit 24-bit
\x1b[38;2;255;0;0mon screen 5.0, attach later from a non-truecolor outer terminal, the colour is quantised by screen's own renderer before being repainted, not lost. The same persistence mechanism means aclearcommand issued inside the session sticks across re-attaches; transient bytes (mouse-wiggle reports, DA responses) are answered immediately at the time of generation and never replayed.