{
  "id": "terminal-dec-private-mode/1016",
  "family": "terminal-dec-private-mode",
  "slug": "1016",
  "title": "DECSET 1016 — SGR-Pixels mouse mode",
  "summary": "CSI ? 1016 h enables SGR-Pixels mouse encoding: like 1006 (SGR) but reports pixel coordinates instead of cell coordinates. CSI ? 1016 l disables it.",
  "kind": "control-sequence",
  "aliases": [
    "DECSET 1016",
    "DECRST 1016",
    "?1016"
  ],
  "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": "DEC-private-mode",
    "command_number": 1016,
    "frame": {
      "introducer_7bit": "\u001b[?",
      "introducer_7bit_readable": "ESC [ ? (0x1B 0x5B 0x3F)",
      "introducer_8bit": "?",
      "introducer_8bit_readable": "0x9B ? (8-bit CSI + '?')",
      "note": "DEC private modes are CSI sequences with a leading '?' (0x3F) private-parameter prefix. Set = final byte 'h' (DECSET); reset = final byte 'l' (DECRST)."
    },
    "terminator": "none",
    "terminator_detail": {
      "note": "No string terminator: a DEC private mode is a CSI sequence ending at its final byte ('h' to set, 'l' to reset)."
    },
    "params": [
      {
        "id": "set",
        "anchor": "#set",
        "name": "Enable (DECSET)",
        "meaning": "CSI ? 1016 h Mouse tracking; SGR pixel coordinates.",
        "required": true,
        "byte_sequence_ST": "\u001b[?1016h",
        "byte_sequence_ST_readable": "ESC [ ? 1016 h",
        "subparams": []
      },
      {
        "id": "reset",
        "anchor": "#reset",
        "name": "Disable (DECRST)",
        "meaning": "CSI ? 1016 l disables the mode.",
        "required": true,
        "byte_sequence_ST": "\u001b[?1016l",
        "byte_sequence_ST_readable": "ESC [ ? 1016 l",
        "subparams": []
      }
    ],
    "gotchas": [
      "Pixel mode reports X/Y in pixels, not cells.",
      "Useful for graphical terminal applications that need sub-cell precision.",
      "Requires 1006 (SGR) to be understood; 1016 is an extension."
    ],
    "v1_smoke_test": {
      "asserts": "DECSET/DECRST 1016 render as byte-exact CSI ? 1016 h/l sequences.",
      "behavioral_conformance": "deferred to v2."
    }
  },
  "updated": "2026-05-29"
}
