wire / terminal-csi / cuu

CSI CUU / CUD / CUF / CUB — Relative Cursor Moves

The four relative cursor-move commands shift the cursor by Pn cells (default 1) in one direction: CUU (final 'A') up, CUD ('B') down, CUF ('C') forward/right, CUB ('D') back/left. They do not scroll and stop at the screen edge.

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

aka: CUU · CUD · CUF · CUB · cursor up · cursor down · cursor forward · cursor back · ESC [ A

frame

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

terminator (none): ST · BEL

parameters / subcommands

idnamebytes (ST)meaning
cuu CUU — Cursor Up (A) \x1b[3A CSI Pn A moves the cursor up Pn rows (default 1). Stops at the top of the page; does not scroll.
cud CUD — Cursor Down (B) \x1b[3B CSI Pn B moves the cursor down Pn rows (default 1).
cuf CUF — Cursor Forward (C) \x1b[3C CSI Pn C moves the cursor right Pn columns (default 1).
cub CUB — Cursor Back (D) \x1b[3D CSI Pn D moves the cursor left Pn columns (default 1).

gotchas


provenance

per-fact attribution:

see also

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