Expand description
Cursor addressing, movement, saving, reporting, and style sequences.
§Category
This module emits cursor-related CSI, ESC, and OSC controls: absolute and relative movement, line/index movement, cursor save/restore forms, cursor style, pointer shape, and cursor-position reports.
§Coordinate conventions
Public cursor-position arguments are zero-based unless the item explicitly says otherwise. Writers add one when the terminal sequence is one-based and omit default parameters when the emitted bytes support a shorter spelling.
row=10 col=20 → ESC [ 11 ; 21 H
──┬── ─┬─ ┬─ ┬
CSI row col final§Mode interaction
Origin mode (Mode::ORIGIN) changes how
terminals interpret absolute row/column positions relative to scroll margins.
Cursor visibility is controlled by Mode::CURSOR_VISIBLE, while this module emits movement and report bytes.
Enums§
- Cursor
Style - Cursor style values for DECSCUSR (
ESC [ Ps SP q).
Functions§
- write_
backtab - Move backward by
ntab stops with CBT,ESC [ <n> Z. - write_
cha - Move the cursor to an absolute column with CHA,
ESC [ <col+1> G. - write_
cht - Advance
nhorizontal tab stops with CHT,ESC [ <n> I. - write_
cnl - Move to the first column of a following line with CNL.
- write_
cpl - Move to the first column of a preceding line with CPL.
- write_
cub - Move the cursor backward/left
ncolumns with CUB. - write_
cud - Move the cursor down
nrows with CUD. - write_
cuf - Move the cursor forward/right
ncolumns with CUF. - write_
cup - Move the cursor to an absolute position with CUP,
ESC [ <row+1> ; <col+1> H. - write_
cursor_ style - Set the cursor style with DECSCUSR,
ESC [ <style> SP q. - write_
cuu - Move the cursor up
nrows with CUU. - write_
hpa - Move to an absolute horizontal position with HPA,
ESC [ <col+1> `. - write_
hpr - Move horizontally right by
ncolumns with HPR,ESC [ <n> a. - write_
hvp - Move the cursor with HVP,
ESC [ <row+1> ; <col+1> f. - write_
index - Move down one line with Index,
ESC D. - write_
request_ cursor_ position - Request a standard cursor-position report with
ESC [ 6 n(DSR 6). - write_
request_ extended_ cursor_ position - Request an extended cursor-position report with
ESC [ ? 6 n(DECXCPR). - write_
restore_ cursor - Restore the cursor with the DEC form
ESC 8(DECRC). - write_
restore_ cursor_ position - Restore the cursor position with CSI
u, exact bytesESC [ u. - write_
reverse_ index - Move up one line with Reverse Index,
ESC M. - write_
save_ cursor - Save the cursor with the DEC form
ESC 7(DECSC). - write_
save_ cursor_ position - Save the cursor position with CSI
s, exact bytesESC [ s. - write_
set_ pointer_ shape - Set the pointer shape with OSC 22,
ESC ] 22 ; <shape> ESC \. - write_
tab - Write a literal horizontal tab byte,
HT(0x09). - write_
vpa - Move the cursor to an absolute row with VPA,
ESC [ <row+1> d. - write_
vpr - Move vertically down by
nrows with VPR,ESC [ <n> e.