DECBI Back Index
Move the cursor one column, scrolling the region sideways at the margin.
ESC 6
- DEC STD 070
- §5.4.3 Back Index, p. 5-39
- VT510
- DECBI—Back Index
The sideways versions of RI and IND: ESC 6 (DECBI) moves the cursor one column left, and ESC 9 (DECFI) one column right. At the edge they scroll instead. DECBI at the left margin shifts the region between the margins one column right, losing the column at the right margin and bringing in a blank one at the left, with the cursor staying put; DECFI at the right margin does the same the other way. With no margins set, the margins are the edges of the screen.
A cursor outside the left and right margins just moves one column, and at the edge of the screen it does nothing. DEC STD 070 defines DECFI at §5.4.3, p. 5-37, and the VT510 manual has DECFI—Forward Index.
DEC STD 070 makes both part of level 4’s horizontal scrolling extension. xterm, a VT420 unless told otherwise, implements them (CASE_DECBI, CASE_DECFI, xtermColIndex), and the cases follow it and esctest2’s decbi.py and decfi.py.
libghostty-vt, a VT220 (see DA), has no case for ESC 6 or ESC 9 in stream.zig and ignores both, so the cases are known differences.
Validation
DECBI-1: Back one column
\e[1;4H
\e6
X
|__X__|
cursor 1,4
DECBI-2: At the left edge, the screen scrolls right
ABCD
\e[1;1H
\e6
|_ABCD|
cursor 1,1
DECBI-3: At the left margin, the region scrolls right
ABCDE
\e[?69h # allow left and right margins
\e[2;4s # margins at columns 2 and 4
\e[1;2H # on the left margin
\e6
|A_BCE|
cursor 1,2
DECBI-4: Left of the margin, it only moves
ABCDE
\e[?69h # allow left and right margins
\e[3;5s # margins at columns 3 and 5
\e[1;2H
\e6
X
|XBCDE|
cursor 1,2
DECBI-5: DECFI forward one column
\e[1;2H
\e9
X
|__X__|
cursor 1,4
DECBI-6: DECFI at the right edge scrolls left
ABCDE
\e[1;5H
\e9
|BCDE_|
cursor 1,5
DECBI-7: DECFI right of the margin only moves
\e[?69h # allow left and right margins
\e[1;3s # margins at columns 1 and 3
\e[1;4H
\e9
X
|____X|