Skip to main content
ansicode
Terminal

macOS Terminal.app — ANSI escape code support

Terminal.app (`/System/Applications/Utilities/Terminal.app`) is the terminal emulator that ships pre-installed on every macOS system. Its VT engine was written by Apple in the late 1990s for NeXTSTEP / Mac OS X 10.0 and has received only incremental updates since — most macOS terminal feature work over the last decade has happened in iTerm2, kitty, WezTerm, alacritty, and most recently Ghostty, not in the Apple-shipped Terminal.app.

For ANSI escape compatibility, Terminal.app is a partial xterm subset: full SGR 0–9 (bold / dim / italic / underline / blink / reverse / hidden / strikethrough), basic 8 + bright 8 + 256-color, and — since macOS 10.7 (Lion, 2011) — 24-bit truecolor support (`$TERM_PROGRAM=Apple_Terminal`, `$TERM_PROGRAM_VERSION` set to the build like `455`). What's NOT supported: OSC 8 hyperlinks (URLs print as literal text), DEC Sixel, the kitty graphics protocol, iTerm2 OSC 1337 inline images, full SGR 4:1–4:5 styled underlines (only flat underline 4:1), DECSET ?2026 synchronized output. Apple's docs are silent — feature-detection happens via `$TERM_PROGRAM`.

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.
    yes
  • 24-bit truecolor (38;2;r;g;b)16.7M direct RGB. Set $COLORTERM=truecolor.
    partial
  • Italic (SGR 3)Italic text attribute.
    yes
  • Styled underlines (4:1–4:5)Curly/dotted/dashed underline styles.
    no
  • Strikethrough (SGR 9)Horizontal line through text.
    yes
  • OSC 8 hyperlinksInline clickable URIs.
    no
  • Alt screen (?1049h)Full-screen app buffer.
    yes
  • Mouse tracking (SGR ?1006)Mouse click/drag events.
    yes
  • Bracketed paste (?2004)Pasted text wrapped in ESC[200~/ESC[201~.
    yes
  • 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.

Quirks & version notes

Per-terminal caveats you'll want to know before relying on a sequence in production.

No OSC 8 hyperlinks — URLs print as literal text
Terminal.app does not implement OSC 8 hyperlink escapes. Apps that emit them (`ls --hyperlink=auto`, `eza --hyperlink`, `gh`, `lazygit`) leak the URL as visible text on macOS Terminal. Workaround: detect `$TERM_PROGRAM=Apple_Terminal` and disable hyperlink emission, or switch to iTerm2 / Ghostty / WezTerm. Terminal.app does support its own URL detection at the rendering layer (Cmd+click on visible URLs / file paths) — but that's heuristic, not the OSC 8 protocol.
Truecolor works since 10.7 but $COLORTERM is not set
Terminal.app accepts SGR 38;2;r;g;b 24-bit color since macOS Lion (10.7, 2011), but it doesn't export `$COLORTERM=truecolor`. Libraries that gate truecolor on the env var (chalk, colorama, click) silently downgrade to 256-color on Terminal.app even though the renderer supports the 24-bit bytes. Override by setting `COLORTERM=truecolor` manually in your shell init (the macOS Terminal.app preference panel has no toggle for this).
No Sixel, no kitty graphics, no iTerm2 OSC 1337 images
Terminal.app has no inline image protocol of any kind. Apps that emit Sixel (chafa, timg), the kitty graphics protocol (`kitten icat`, neovim image plugins), or OSC 1337 (iTerm2's `imgcat`) print the raw escape bytes as garbage on macOS Terminal. There is no roadmap — Apple has not engaged the terminal protocol committees. For inline image rendering on macOS, the modern alternatives are iTerm2 (its own OSC 1337), kitty (its own APC G protocol), or WezTerm / Ghostty (which support all three).
$TERM defaults to xterm-256color — but feature-set isn't xterm parity
Terminal.app exports `$TERM=xterm-256color` for compatibility, which causes libraries that read $TERM to assume xterm-level support — including OSC 8, Smulx styled underlines, and (sometimes) Sixel. None of these actually work on Terminal.app. The fix is for tools to additionally check `$TERM_PROGRAM=Apple_Terminal` and downgrade the feature set accordingly; `bat`, `delta`, `eza`, `gh`, `kitten icat`, and `chafa` all do this. Or override `$TERM=apple-terminal` (Apple ships the terminfo entry but doesn't use it by default).

Citations

Other terminals with landing pages