Skip to main content
ansicode

DECDC / DECIC — Delete / insert column (CSI Pn ' ~ / CSI Pn ' })

Delete (DECDC) or insert (DECIC) Pn columns at the cursor — the column-oriented counterparts of DL (CSI Pn M) and IL (CSI Pn L).

Byte forms

Every common string-literal form so you can paste-and-search either direction.

\\x1b[\x1b[<Pn>'~ (DECDC) \x1b[<Pn>'} (DECIC)
\\033[\033[1'~ / \033[1'}
\\e[\e[1'~ / \e[1'}
ESC [ESC [ Pn ' ~ / ESC [ Pn ' }
hex1b 5b ... 27 7e / 1b 5b ... 27 7d

Description

DEC VT520+ rectangular editing primitives. **DECDC** (`\x1b[<Pn>'~`) deletes `Pn` columns starting at the cursor column — every cell to the right of the deletion shifts left by `Pn`, and the rightmost `Pn` columns are filled with blanks using the current SGR background. **DECIC** (`\x1b[<Pn>'}`) is the inverse — `Pn` blank columns are inserted at the cursor column, shifting existing content rightward and discarding whatever falls off the right edge. Both honour DECSTBM (vertical scroll region) **and** DECSLRM (horizontal scroll region) when those are active, so editing happens within the active rectangle rather than the whole screen. Note the intermediate byte: literal apostrophe `'` (0x27) between parameter and final byte — easy to omit when hand-typing. Defaults to `Pn=1`. Support is thin outside xterm and wezterm — many emulators (alacritty, ghostty, kitty's main mode) ignore them. Used historically by VT520 spreadsheet / form editors; modern TUIs almost universally redraw instead.

Spec citation: DEC VT520 RM (DECDC / DECIC) / xterm-ctlseqs

Parameters

PnNumber of columns to delete (DECDC) or insert (DECIC). Default 1.

Examples

bash
printf '\033[3\x27~'   # DECDC: delete 3 cols at cursor (note literal ' before ~)
python
import sys; sys.stdout.write("\x1b[2'}")   # DECIC: insert 2 blank cols
go
fmt.Print("\x1b[1'~")   // DECDC: delete 1 col
javascript
process.stdout.write("\x1b[5'}")   // DECIC: insert 5 cols
c
printf("\x1b[1'~");   /* DECDC: delete one column at cursor */

Terminal support

xterm
yes
Linux console (fbcon)
no
macOS Terminal.app
no
iTerm2
partial
Windows Terminal
no
cmd.exe / ConPTY
no
kitty
no
alacritty
no
WezTerm
yes
Ghostty
no
GNOME Terminal
no
Konsole
partial
tmux
no
GNU screen
no

Related sequences