{
  "id": "terminal-osc/5",
  "family": "terminal-osc",
  "slug": "5",
  "title": "OSC 5 — Special color (xterm)",
  "summary": "OSC 5 sets a special color (xterm extension): OSC 5 ; c ; spec ST sets special color index c.",
  "kind": "control-sequence",
  "aliases": [
    "OSC 5",
    "OSC 5 — Special color (xterm)"
  ],
  "status": "de-facto",
  "verification": "verified",
  "tier": "B",
  "source_url": "https://invisible-island.net/xterm/ctlseqs/ctlseqs.html",
  "source_version": "xterm ctlseqs, patch #410, 2026/04/19",
  "retrieved_date": "2026-05-29",
  "see_also": [],
  "ext_type": "terminal-escape@1",
  "ext": {
    "csi_or_osc": "OSC",
    "command_number": 5,
    "frame": {
      "introducer_7bit": "\u001b]",
      "introducer_7bit_readable": "ESC ] (0x1B 0x5D)",
      "introducer_8bit": "",
      "introducer_8bit_readable": "0x9D (single-byte OSC, 8-bit C1)",
      "note": "OSC 5 ; ... ST."
    },
    "terminator": "ST|BEL",
    "terminator_detail": {
      "canonical_ST_7bit": "\u001b\\",
      "alt_BEL": "\u0007",
      "note": "ECMA-48 mandates ST; BEL is widely accepted."
    },
    "params": [
      {
        "id": "set",
        "anchor": "#set",
        "name": "Set special color",
        "meaning": "OSC 5 ; c ; spec ST sets special color index c.",
        "required": true,
        "byte_sequence_ST": "\u001b]5;0;#ff0000\u001b\\",
        "byte_sequence_ST_readable": "ESC ] 5 ; 0 ; #ff0000 ST",
        "subparams": []
      }
    ],
    "gotchas": [
      "OSC 5 is an xterm extension for special colors (e.g., cursor text color).",
      "Rarely used in practice."
    ],
    "v1_smoke_test": {
      "asserts": "OSC 5 renders as a byte-exact ST-terminated OSC sequence.",
      "behavioral_conformance": "deferred to v2."
    }
  },
  "updated": "2026-05-29"
}
