^[control-codes
live in libghostty-vt

Control sequences

VPA Line Position Absolute

View as Markdown

Move the cursor to line n, keeping its column.

CSI Pn d
Defaults
Pn = 1
ECMA-48
§8.3.158 VPA – Line Position Absolute, p. 74
VT510
VPA—Vertical Line Position Absolute

Move the cursor to line Pn, counting from 1, keeping its column. A 0 is taken as 1. The VT510 manual says that an attempt to move below the last line stops on the last line.

It is the vertical counterpart of HPA, and like HPA, ECMA-48 defines it for the data component, which a terminal does not have apart from its screen (§6, p. 14). The relative forms are VPR and VPB, and CUP sets the line and column together.

The VT510 manual’s one-line summary of VPA is a copying error, as it is for HPA, and so is its “Parameters” entry, which calls Pn a column number. The description beneath them is the right one.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984Nonot in the manual
VT510manual, 1st ed., 1993YesVPA
xtermpatch 412, xterm-411aYes
libghostty-vt0f171f6Yes
kitty0.49.1, run in a VMYespasses the 3 cases that show it working
foot1.28.0, run in a VMYespasses the 3 cases that show it working
pyte0.8.2, run as a libraryYespasses 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 documentationYes“Moves the cursor to line row”; 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

VPA-1: To a line, keeping the column

\e[1;3H
\e[3d
X
|_____|
|_____|
|__X__|

VPA-2: To the first line by default

\e[3;2H
\e[d
X
|_X___|
|_____|
|_____|

VPA-3: Stops at the last line

\e[1;4H
\e[99d
X
|_____|
|_____|
|___X_|
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.