DECIC Insert Column
Insert or delete whole columns at the cursor, shifting the rest of the scrolling region sideways.
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.
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|