^[control-codes
live in libghostty-vt

Control sequences

CHT Cursor Horizontal Tabulation

View as Markdown

Move the cursor forward n tab stops.

CSI Pn I
Defaults
Pn = 1
ECMA-48
§8.3.10 CHT – Cursor Forward Tabulation, p. 34
VT510
CHT—Cursor Horizontal Forward Tabulation

Do what a horizontal tab does, Pn times: move the cursor right to the next tab stop, stopping at the right margin if there are no more. A 0 is taken as 1. CBT goes the other way.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984Nonot in the manual
VT510manual, 1st ed., 1993YesCHT
xtermpatch 412, xterm-411aYes
libghostty-vt0f171f6Yes
kitty0.49.1, run in a VMYespasses the 2 cases that show it working
foot1.28.0, run in a VMPartlyfails CHT-3 of the 3 cases that show it working
pyte0.8.2, run as a libraryNofails the 3 cases that show it working
xterm.js headless6.0.0, run as a libraryYespasses the 3 cases that show it working
alacritty_terminal0.26.0, run as a libraryYespasses the 3 cases that show it working
ConEmubuild 230724, its documentationNonot in its list: ANSI escape codes
rxvt-unicode9.31, run in a VMYespasses the 3 cases that show it working
VTE0.84.1, run as a libraryYespasses the 3 cases that show it working

Validation

CHT-1: One tab stop

\e[?5W    # reset tab stops
\e[I
X
|________X___________|

CHT-2: Several tab stops

\e[?5W    # reset tab stops
\e[2I
X
|________________X___|

CHT-3: Stops at the right margin

\e[?5W    # reset tab stops
\e[9I
X
|___________________X|
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.