VPR Line Position Forward
Move the cursor down n lines, keeping its column.
CSI Pn e
- Defaults
- Pn = 1
- ECMA-48
- §8.3.160 VPR – Line Position Forward, p. 74
- VT510
- VPR—Vertical Position Relative
Move the cursor down Pn lines, keeping its column. A 0 is taken as 1. The VT510 manual says that an attempt to move below the last line stops at the last line. It never scrolls.
It is a relative move, so origin mode makes no difference to it: the cursor moves Pn lines from wherever it is.
ECMA-48 names it for the data component, which a terminal does not have apart from its screen (§6, p. 14). Going up is VPB, and the absolute form is VPA. The VT510 manual’s one-line summary and “Parameters” entry for VPR are copying errors, as they are for VPA; the description beneath them is the right one.
Support
| Terminal | Version | Support | Notes |
|---|---|---|---|
| VT220 | manual, 2nd ed., 1984 | No | not in the manual |
| VT510 | manual, 1st ed., 1993 | Yes | VPR |
| xterm | patch 412, xterm-411a | Yes | |
| libghostty-vt | 0f171f6 | Yes | VPR-4: in origin mode the move is offset by the top and left margins |
| kitty | 0.49.1, run in a VM | Partly | fails VPR-4 of the 4 cases that show it working |
| foot | 1.28.0, run in a VM | Partly | fails VPR-4 of the 4 cases that show it working |
| pyte | 0.8.2, run as a library | Partly | fails VPR-4 of the 4 cases that show it working |
| xterm.js headless | 6.0.0, run as a library | Partly | fails VPR-4 of the 4 cases that show it working |
| alacritty_terminal | 0.26.0, run as a library | Partly | fails VPR-4 of the 4 cases that show it working |
| ConEmu | build 230724, its documentation | No | not in ConEmu’s list; ANSI escape codes |
| rxvt-unicode | 9.31, run in a VM | Partly | fails VPR-4 of the 4 cases that show it working |
| VTE | 0.84.1, run as a library | No | fails the 4 cases that show it working |
Validation
VPR-1: One line by default
\e[1;2H
\e[e
X
|_____|
|_X___|
|_____|
VPR-2: n lines
\e[1;4H
\e[2e
X
|_____|
|_____|
|___X_|
VPR-3: Stops at the last line, without scrolling
A
\e[2;3H
\e[99e
X
|A____|
|_____|
|__X__|
VPR-4: The same in origin mode
\e[2;5r # region is lines 2 to 5
\e[?69h # allow left and right margins
\e[2;6s # margins at columns 2 and 6
\e[?6h # origin mode
\e[1;2H # line 2, column 3 of the screen
X
\e[2e
Y
\e[?6l
|_______|
|__X____|
|_______|
|___Y___|
|_______|
The Y should be two lines below the cell after X, which is what esctest2’s test_VPR_IgnoresOriginMode checks. libghostty-vt puts it further down and further right. VPR there is setCursorPos(current line + 1 + Pn, current column + 1), and in origin mode setCursorPos adds the margins to both, so the move is offset by the top margin and the column by the left margin.