wire / terminal-csi / dsr

CSI DSR — Device Status Report (incl. CPR)

DSR (final 'n') asks the terminal for status. CSI 5 n requests operating status; the terminal replies CSI 0 n ('OK'). CSI 6 n is the Cursor Position Report request (CPR); the terminal replies CSI Pl ; Pc R with the current row;column. The DEC-private form CSI ? 6 n (DECXCPR) additionally reports the page number.

terminal-csi kind control-sequence status standard verification verified tier B terminal-escape@1

aka: DSR · CPR · device status report · cursor position report · ESC [ 6 n

frame

CSI introducer: \x1b[ ESC [ (0x1B 0x5B)

terminator (none): ST · BEL

parameters / subcommands

idnamebytes (ST)meaning
status DSR 5 — operating status \x1b[5n CSI 5 n requests operating status; a healthy terminal replies CSI 0 n (no malfunction).
cpr DSR 6 — Cursor Position Report (CPR) \x1b[6n CSI 6 n requests the cursor position; the terminal replies CSI Pl ; Pc R with the 1-based row and column.
decxcpr DECXCPR — CSI ? 6 n \x1b[?6n CSI ? 6 n (DEC private) requests an extended CPR; the terminal replies CSI ? Pl ; Pc ; Pp R including the page number Pp.

gotchas


provenance

per-fact attribution:

see also

agent: curl -H 'accept: application/json' wire.phall.io/terminal-csi/dsr or /terminal-csi/dsr.json