wire / terminal-csi / decstbm

CSI DECSTBM — Set Top and Bottom Margins (scroll region)

DECSTBM (final 'r') sets the vertical scrolling region to rows Pt (top) through Pb (bottom): CSI Pt ; Pb r. Scrolling, IL/DL, and SU/SD then act only within this region. 'CSI r' with no parameters resets the region to the full screen. After setting, the cursor moves to the home position (top-left, or top of region under origin mode).

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

aka: DECSTBM · scroll region · set margins · top bottom margins · ESC [ r

frame

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

terminator (none): ST · BEL

parameters / subcommands

idnamebytes (ST)meaning
set Set scroll region \x1b[5;20r CSI Pt ; Pb r sets the scrolling region to rows Pt..Pb (1-based, inclusive). Subsequent scrolling, IL/DL, and SU/SD are confined to this region. The cursor moves to home afterward.
reset Reset to full screen \x1b[r CSI r (no parameters) resets the scrolling region to the entire screen.

gotchas


provenance

per-fact attribution:

see also

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