^[control-codes
live in libghostty-vt

Control sequences

DECIC, DECDC Insert and Delete Column

View as Markdown

Insert or delete whole columns at the cursor, shifting the rest of the scrolling region sideways.

DECIC Insert Column

CSI Pn ' }

DECDC Delete Column

CSI Pn ' ~
Defaults
Pn = 1
DEC STD 070
§5.11 Insert Column, p. 5-150
VT510
DECIC—Insert Column

CSI Pn ' } (DECIC) inserts Pn blank columns at the cursor’s column, and CSI Pn ' ~ (DECDC) deletes Pn columns there. They are ICH and DCH for every line of the scrolling region at once: only the part of the screen between the top, bottom, left and right margins moves. Inserted columns push the rest of the region right, and what passes the right margin is lost; deleting pulls it left, and blank columns come in at the right margin. A 0 is taken as 1, and the cursor does not move.

Both do nothing if the cursor is outside the margins. DEC STD 070 defines DECDC at §5.11, p. 5-151, and the VT510 manual has DECDC—Delete Column.

These are VT420 functions: DEC STD 070 makes them part of level 4’s horizontal scrolling extension. xterm is a VT420 unless told otherwise (DFT_DECID), and it implements both (CASE_DECDC, CASE_DECIC, which shift each line of the region with xtermColScroll). The cases follow xterm, and esctest2’s decic.py and decdc.py test the same things.

libghostty-vt identifies itself as a VT220 (see DA) and does not implement either. Its CSI dispatch in stream.zig handles a final } only with the intermediate $, for DECSASD, and has no case for ~, so both are ignored, and the cases below that change the screen are marked as known differences.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984Nonot in the manual
VT510manual, 1st ed., 1993YesDECIC, DECDC
xtermpatch 412, xterm-411aYes
libghostty-vt0f171f6Noignores DECIC and DECDC
kitty0.49.1, run in a VMNofails the 6 cases that show it working
foot1.28.0, run in a VMNofails the 6 cases that show it working
pyte0.8.2, run as a libraryNofails the 6 cases that show it working
xterm.js headless6.0.0, run as a libraryPartlyfails DECIC-4, DECIC-7 of the 6 cases that show it working
alacritty_terminal0.26.0, run as a libraryNofails the 6 cases that show it working
ConEmubuild 230724, its documentationNonot in its list: ANSI escape codes
rxvt-unicode9.31, run in a VMNofails the 6 cases that show it working
VTE0.84.1, run as a libraryYespasses the 6 cases that show it working

Validation

DECIC-1: Insert one column

ABCDE\r\n
FGHIJ
\e[1;2H
\e['}
|A_BCDE|
|F_GHIJ|
cursor 1,2

DECIC-2: Columns pushed past the edge are lost

ABCDE
\e[1;2H
\e[2'}
|A__BCD|

DECIC-3: Only within the top and bottom margins

ABC\r\n
DEF\r\n
GHI
\e[2;3r   # region is lines 2 and 3
\e[2;2H
\e['}
|ABC_|
|D_EF|
|G_HI|

DECIC-4: Only within the left and right margins

ABCDEFG
\e[?69h   # allow left and right margins
\e[2;5s   # margins at columns 2 and 5
\e[1;3H
\e['}
|AB_CDFG|

DECIC-5: Nothing outside the margins

ABCDEFG
\e[?69h   # allow left and right margins
\e[2;5s   # margins at columns 2 and 5
\e[1;1H   # outside them
\e[3'}
|ABCDEFG|

This one passes in libghostty-vt only because it ignores DECIC altogether.

DECIC-6: DECDC deletes one column

ABCDE\r\n
FGHIJ
\e[1;2H
\e['~
|ACDE__|
|FHIJ__|
cursor 1,2

DECIC-7: DECDC within a right margin

ABCDEF
\e[?69h   # allow left and right margins
\e[1;4s   # margins at columns 1 and 4
\e[1;2H
\e[2'~
|AD__EF|
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.