Expand description
Device Status Reports and cursor-position reports.
§Category
This module emits DSR requests and report responses: cursor position, extended cursor position, and light/dark preference reporting.
§CSI conventions
ANSI DSR uses ESC [ Ps n; DEC-private DSR inserts ?. Cursor reports use
final byte R, while light/dark reports use private DSR numbers.
§Mode interaction
The light/dark notification request is related to
Mode::LIGHT_DARK, DEC private mode
2031. Cursor-position reports are independent of modes but may be interpreted
relative to terminal origin behavior.
Constants§
- REQUEST_
CURSOR_ POSITION - Request standard cursor position: exact bytes
ESC [ 6 n(b"\x1b[6n"). - REQUEST_
EXTENDED_ CURSOR_ POSITION - Request extended cursor position: exact bytes
ESC [ ? 6 n(b"\x1b[?6n"). - REQUEST_
LIGHT_ DARK_ REPORT - Request light/dark preference report: exact bytes
ESC [ ? 996 n(b"\x1b[?996n").
Functions§
- write_
cpr - Encode a standard Cursor Position Report response,
ESC [ <line> ; <column> R. - write_
decxcpr - Encode an extended Cursor Position Report response.
- write_
dsr_ request - Encode a Device Status Report request.
- write_
light_ dark_ report - Encode a light/dark report response.
- write_
request_ cursor_ position - Write
REQUEST_CURSOR_POSITION, the standard DSR 6 cursor-position request. - write_
request_ extended_ cursor_ position - Write
REQUEST_EXTENDED_CURSOR_POSITION, the DEC private extended cursor-position request. - write_
request_ light_ dark_ report - Write
REQUEST_LIGHT_DARK_REPORT, the light/dark preference query.