# Control sequences

> CSI, then parameters, then a final byte: the bulk of what a terminal understands.

CSI, then parameters, then a final byte: the bulk of what a terminal understands.

- [DECCARA: Change Attributes in Rectangular Area](https://control-codes.page/csi/deccara/index.html.md): Change or reverse the rendition of a rectangle of the screen without rewriting its characters.
- [HPA: Character Position Absolute](https://control-codes.page/csi/hpa/index.html.md): Move the cursor to column n of the line it is on.
- [HPB: Character Position Backward](https://control-codes.page/csi/hpb/index.html.md): Move the cursor left n columns.
- [HPR: Character Position Forward](https://control-codes.page/csi/hpr/index.html.md): Move the cursor right n columns.
- [DECCRA: Copy Rectangular Area](https://control-codes.page/csi/deccra/index.html.md): Copy a rectangle of the screen, characters and attributes, to another place.
- [CUB: Cursor Backward](https://control-codes.page/csi/cub/index.html.md): Move the cursor left n columns.
- [CBT: Cursor Backward Tabulation](https://control-codes.page/csi/cbt/index.html.md): Move the cursor back to the previous tab stop, n times.
- [CHA: Cursor Character Absolute](https://control-codes.page/csi/cha/index.html.md): Move the cursor to column n of the line it is on.
- [CUD: Cursor Down](https://control-codes.page/csi/cud/index.html.md): Move the cursor down n lines.
- [CUF: Cursor Forward](https://control-codes.page/csi/cuf/index.html.md): Move the cursor right n columns.
- [CHT: Cursor Horizontal Tabulation](https://control-codes.page/csi/cht/index.html.md): Move the cursor forward n tab stops.
- [CNL: Cursor Next Line](https://control-codes.page/csi/cnl/index.html.md): Move the cursor down n lines, to the start of the line.
- [CUP: Cursor Position](https://control-codes.page/csi/cup/index.html.md): Move the cursor to a given line and column.
- [CPL: Cursor Preceding Line](https://control-codes.page/csi/cpl/index.html.md): Move the cursor up n lines, to the start of the line.
- [CTC: Cursor Tabulation Control](https://control-codes.page/csi/ctc/index.html.md): Set or clear tab stops: at the cursor, or all of them.
- [CUU: Cursor Up](https://control-codes.page/csi/cuu/index.html.md): Move the cursor up n lines.
- [DECDSR: DEC Device Status Reports](https://control-codes.page/csi/decdsr/index.html.md): DEC's private status requests: the extended cursor position, the printer, the keyboard, macro space and the like.
- [DECRST: DEC Private Mode Reset](https://control-codes.page/csi/decrst/index.html.md): Turn one or more DEC private modes off.
- [DECSET: DEC Private Mode Set](https://control-codes.page/csi/decset/index.html.md): Turn one or more DEC private modes on.
- [DCH: Delete Character](https://control-codes.page/csi/dch/index.html.md): Delete n characters at the cursor, pulling the rest of the line left.
- [DL: Delete Line](https://control-codes.page/csi/dl/index.html.md): Delete n lines at the cursor, pulling the lines below it up.
- [DA: Device Attributes](https://control-codes.page/csi/da/index.html.md): Ask the terminal what kind of terminal it is.
- [DSR: Device Status Report](https://control-codes.page/csi/dsr/index.html.md): Ask the terminal for its status or for the cursor position, and get a report back.
- [ECH: Erase Character](https://control-codes.page/csi/ech/index.html.md): Blank n characters from the cursor rightwards, without moving anything.
- [ED: Erase in Display](https://control-codes.page/csi/ed/index.html.md): Erase part or all of the screen.
- [EL: Erase in Line](https://control-codes.page/csi/el/index.html.md): Erase part or all of the cursor's line.
- [DECERA: Erase Rectangular Area](https://control-codes.page/csi/decera/index.html.md): Erase every character in a rectangle of the screen.
- [DECFRA: Fill Rectangular Area](https://control-codes.page/csi/decfra/index.html.md): Fill a rectangle of the screen with one character, in the current rendition.
- [HVP: Horizontal and Vertical Position](https://control-codes.page/csi/hvp/index.html.md): Move the cursor to a given line and column, as CUP does.
- [DECIC: Insert Column](https://control-codes.page/csi/decic/index.html.md): Insert or delete whole columns at the cursor, shifting the rest of the scrolling region sideways.
- [ICH: Insert Character](https://control-codes.page/csi/ich/index.html.md): Insert n blank cells at the cursor, shifting the rest of the line right.
- [IL: Insert Line](https://control-codes.page/csi/il/index.html.md): Insert n blank lines at the cursor, pushing the lines below it down.
- [DECTST: Invoke Confidence Test](https://control-codes.page/csi/dectst/index.html.md): Run the terminal's own self-tests, after which nothing about its state can be relied on.
- [XTMODKEYS: Set Key Modifier Options](https://control-codes.page/csi/xtmodkeys/index.html.md): Choose how keys pressed with Shift, Control or Alt are sent, and ask what is chosen.
- [CSI = u: Kitty Keyboard Protocol](https://control-codes.page/csi/kitty-keyboard/index.html.md): Ask the terminal to report keys unambiguously, with every modifier and with releases, through a stack of flags.
- [VPA: Line Position Absolute](https://control-codes.page/csi/vpa/index.html.md): Move the cursor to line n, keeping its column.
- [VPB: Line Position Backward](https://control-codes.page/csi/vpb/index.html.md): Move the cursor up n lines, keeping its column.
- [VPR: Line Position Forward](https://control-codes.page/csi/vpr/index.html.md): Move the cursor down n lines, keeping its column.
- [DECELR: Enable Locator Reports](https://control-codes.page/csi/decelr/index.html.md): Report the position of a mouse or tablet, the locator, to the host.
- [MC: Media Copy](https://control-codes.page/csi/mc/index.html.md): Print the screen, or send what the host sends to a printer instead of the screen.
- [NP: Next Page](https://control-codes.page/csi/np/index.html.md): Move to another page of display memory, on terminals that have more than one.
- [REP: Repeat](https://control-codes.page/csi/rep/index.html.md): Print the character before it n more times.
- [XTVERSION: Report Version](https://control-codes.page/csi/xtversion/index.html.md): Ask the terminal for its name and version.
- [DECRQCRA: Request Checksum of Rectangular Area](https://control-codes.page/csi/decrqcra/index.html.md): Ask for a checksum of part of the screen, to check it has not changed.
- [DECRQM: Request Mode](https://control-codes.page/csi/decrqm/index.html.md): Ask the terminal whether a mode is set, and get a DECRPM report back.
- [DECRQPSR: Request Presentation State Report](https://control-codes.page/csi/decrqpsr/index.html.md): Ask for the cursor's state or the tab stops, as a report that can be sent back later to restore them.
- [RM: Reset Mode](https://control-codes.page/csi/rm/index.html.md): Turn one or more ANSI modes off.
- [SD: Scroll Down](https://control-codes.page/csi/sd/index.html.md): Move the contents of the scrolling region down n lines.
- [SL: Scroll Left](https://control-codes.page/csi/sl/index.html.md): Move the contents of the scrolling region left or right by n columns.
- [SU: Scroll Up](https://control-codes.page/csi/su/index.html.md): Move the contents of the scrolling region up n lines.
- [DECSR: Secure Reset](https://control-codes.page/csi/decsr/index.html.md): Reset the terminal to its power-up state, erase everything the host could have stored in it, and confirm that it was done.
- [DECSCL: Select Conformance Level](https://control-codes.page/csi/decscl/index.html.md): Make the terminal behave as an earlier level of DEC terminal, with a soft reset.
- [SGR: Select Graphic Rendition](https://control-codes.page/csi/sgr/index.html.md): Set the colors and attributes of the characters written after it.
- [SIMD: Select Implicit Movement Direction](https://control-codes.page/csi/simd/index.html.md): ECMA-48's choice of which way text runs, which xterm takes as Scroll Down.
- [DECSNLS: Select Number of Lines per Screen](https://control-codes.page/csi/decsnls/index.html.md): Choose how many lines the screen shows at once.
- [DECSCA: Select Character Protection Attribute](https://control-codes.page/csi/decsca/index.html.md): Protect characters from erasure, then erase everything else on the line or the screen.
- [DECSCPP: Set Columns Per Page](https://control-codes.page/csi/decscpp/index.html.md): Make the page 80 or 132 columns wide, without clearing it.
- [DECSCUSR: Set Cursor Style](https://control-codes.page/csi/decscusr/index.html.md): Choose the cursor's shape, and whether it blinks.
- [DECSLRM: Set Left and Right Margins](https://control-codes.page/csi/decslrm/index.html.md): Set the columns of the scrolling region, once left and right margins are enabled.
- [SM: Set Mode](https://control-codes.page/csi/sm/index.html.md): Turn one or more ANSI modes on.
- [DECSTBM: Set Top and Bottom Margins](https://control-codes.page/csi/decstbm/index.html.md): Set the lines of the scrolling region.
- [DECSTR: Soft Terminal Reset](https://control-codes.page/csi/decstr/index.html.md): Put the modes and settings a program may have changed back to their defaults, leaving the screen alone.
- [DECSASD: Select Active Status Display](https://control-codes.page/csi/decsasd/index.html.md): Show a status line below the screen, and send text to it instead of the screen.
- [TBC: Tabulation Clear](https://control-codes.page/csi/tbc/index.html.md): Clear the tab stop at the cursor, or every tab stop.
- [DECRQTSR: Request Terminal State Report](https://control-codes.page/csi/decrqtsr/index.html.md): Ask for most of the terminal's settable state in one compact report, and send it back later to restore it.
- [XTWINOPS: Window Operations](https://control-codes.page/csi/xtwinops/index.html.md): Move, resize and raise the window, report its size and state, and save and restore its title.

---

This is the Markdown version of <https://control-codes.page/csi/>. On that page every validation case runs live in libghostty-vt, the terminal emulation core of Ghostty, compiled to WebAssembly.
