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
| Parameter | Description | Default |
|---|---|---|
Pn | Line (VPA) or column (HPA) number | 1 |
Description
Per ECMA-48 §8.3.158 (VPA) and §8.3.57 (HPA):
- VPA (
CSI Pn d) — Moves the cursor to linePnwithout changing the column. This is the vertical equivalent of CHA. - HPA (
CSI Pn \``) — Moves the cursor to character positionPnwithout 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
| Specification | Section |
|---|---|
| ECMA-48 | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | 0.1.0 | Supported via goto_line and goto_col methods |
| Bobcat | ✓ | 0.9.0 | Supported via TerminalCtrl library |
| contour | ✓ | v0.1.0 | |
| foot | ✓ | Yes | VPA (d) at csi.c:878-884, HPA (G/`) at csi.c:946-952 |
| Ghostty | ✓ | v1.0.0 | |
| iTerm2 | ✓ | Yes | ANSICSI_VPA and ANSICSI_CHA tokens parsed and executed via terminalSetCursorY and terminalSetCursorX |
| Kitty | ✓ | Yes | VPA/HPA (CSI d/`) fully implemented in vt-parser.c:1208-1212 |
| Konsole | ✓ | Yes | VPA (d), HPA (`) implemented at src/Vt102Emulation.cpp:2148,2122 |
| mintty | ✓ | Yes | VPA (CSI d) at line 3171-3174, HPA (CSI `) at line 3165-3170 |
| mlterm | ✓ | rel-2_9_0 | VPA 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.0 | HPA is handled via CHA handler |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | Fully implemented in vteseq.cc as VPA/HPA handlers |
| WezTerm | ✓ | Yes | VPA (LinePositionAbsolute) and HPA (CharacterPositionAbsolute) implemented as Cursor::LinePositionAbsolute and Cursor::CharacterPositionAbsolute |
| Windows Terminal | ✓ | Yes | VPA 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.9 | VPA (CSI d) in 1.6; HPA with backtick (CSI `) added in 2.9 |
| tuios | ✓ | v0.0.15 | |
| Zellij | ✓ | v0.9.0 | VPA (CSI d) added in v0.1.0-alpha, HPA (CSI `) added in v0.9.0 |
See also
- CHA/CUP — Absolute Cursor Positioning — CHA (column) and CUP (row+column)
- CUU/CUD/CUF/CUB — Relative Cursor Movement — Relative movement