Skip to main content

VPA/HPA

AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Standard

VPA (Line Position Absolute) and HPA (Character Position Absolute) are CSI sequences that set the cursor's row or column independently without affecting the other coordinate.

Syntax​

CSI Pn d      VPA — Line Position Absolute (set row)
CSI Pn ` HPA — Character Position Absolute (set column)
Formal syntax
VPA = 0x1b, "[", [ Pn ], "d" ;
HPA = 0x1b, "[", [ Pn ], 0x60 ;         (* 0x60 = backtick *)
Pn  = digit, { digit } ;                (* default: 1 *)
digit = "0" | "1" | "2" | "3" | "4"
    | "5" | "6" | "7" | "8" | "9" ;

Parameters​

ParameterDescriptionDefault
PnLine (VPA) or column (HPA) number1

Description​

Per ECMA-48 §8.3.158 (VPA) and §8.3.57 (HPA):

  • VPA (CSI Pn d) — Moves the cursor to line Pn without changing the column. This is the vertical equivalent of CHA.
  • HPA (CSI Pn \``) — Moves the cursor to character position Pn without changing the row. Functionally identical to CHA (CSI Pn G`).

Positions are 1-based. Values exceeding the screen dimensions are clamped.

note

HPA and CHA are functionally equivalent in practice — both set the column. The distinction in ECMA-48 is that HPA operates on the data component while CHA operates on the presentation component, but this difference is not meaningful in modern terminal emulators.

Examples​

printf '\e[5d'       # Move to row 5, keep current column
printf '\e[10`' # Move to column 10, keep current row

Specifications​

SpecificationSection
ECMA-48—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✓0.1.0Supported via goto_line and goto_col methods
Bobcat✓0.9.0Supported via TerminalCtrl library
contour✓v0.1.0
foot✓YesVPA (d) at csi.c:878-884, HPA (G/`) at csi.c:946-952
Ghostty✓v1.0.0
iTerm2✓YesANSICSI_VPA and ANSICSI_CHA tokens parsed and executed via terminalSetCursorY and terminalSetCursorX
Kitty✓YesVPA/HPA (CSI d/`) fully implemented in vt-parser.c:1208-1212
Konsole✓YesVPA (d), HPA (`) implemented at src/Vt102Emulation.cpp:2148,2122
mintty✓YesVPA (CSI d) at line 3171-3174, HPA (CSI `) at line 3165-3170
mlterm✓rel-2_9_0VPA at vt_parser.c:5794-5801, HPA at vt_parser.c:5616-5626
PuTTY✓0.45
Rio✓v0.0.3
rxvt-unicode✓1.2
st✓0.1
terminology✓v0.1.0HPA is handled via CHA handler
VT100✗No
VTE✓YesFully implemented in vteseq.cc as VPA/HPA handlers
WezTerm✓YesVPA (LinePositionAbsolute) and HPA (CharacterPositionAbsolute) implemented as Cursor::LinePositionAbsolute and Cursor::CharacterPositionAbsolute
Windows Terminal✓YesVPA at ITermDispatch.hpp:48, HPA/CHA at line 47. Both absolute positioning methods implemented.
xterm✓xterm-406
xterm.js✓2.3.0
Multiplexers
cy✓v0.1.0
GNU Screen✓v.4.2.0
tmux✓2.9VPA (CSI d) in 1.6; HPA with backtick (CSI `) added in 2.9
tuios✓v0.0.15
Zellij✓v0.9.0VPA (CSI d) added in v0.1.0-alpha, HPA (CSI `) added in v0.9.0

See also​