Skip to main content
ansicode

HVP — Horizontal and vertical position (CSI f, alias of CUP)

Move the cursor to absolute (row, col) — semantically identical to CUP but uses final byte `f` instead of `H`.

Byte forms

Every common string-literal form so you can paste-and-search either direction.

\\x1b[\x1b[<row>;<col>f
\\033[\033[1;1f
\\e[\e[1;1f
ESC [ESC [ row ; col f
hex1b 5b ... 66

Description

Horizontal and Vertical Position. ECMA-48 §8.3.61 defines HVP with the SAME semantics as CUP (`\x1b[r;cH`, §8.3.21) — move the cursor to the absolute 1-based row/col, default (1,1), values clamped to the visible region. The difference is purely the final byte: `H` (0x48) for CUP, `f` (0x66) for HVP. Both are widely emitted in the wild — some applications still use the older `f` form, notably parts of curses' default capability table and certain DEC VT-clone test vectors. Treat HVP exactly like CUP when decoding; emit CUP (`H`) when writing new code unless you need to match a legacy stream. Note: in ECMA-48 HVP was historically the canonical primitive and CUP the synonym; xterm-ctlseqs reverses the relationship and treats CUP as primary, reflecting modern usage.

Spec citation: ECMA-48 §8.3.61 (HVP) / xterm-ctlseqs

Examples

bash
printf '\033[2;5fHello at (2,5)\n'   # same as \033[2;5H
python
print('\x1b[2;5fHello at (2,5)')
go
fmt.Print("\x1b[2;5fHello at (2,5)\n")
javascript
process.stdout.write('\x1b[2;5fHello at (2,5)\n')
c
printf("\x1b[2;5fHello at (2,5)\n");

Terminal support

xterm
yes
Linux console (fbcon)
yes
macOS Terminal.app
yes
iTerm2
yes
Windows Terminal
yes
cmd.exe / ConPTY
yes
kitty
yes
alacritty
yes
WezTerm
yes
Ghostty
yes
GNOME Terminal
yes
Konsole
yes
tmux
no
GNU screen
no

Related sequences

In the family cookbook

CSI cookbook · 2. Cursor movement — CUU / CUD / CUF / CUB + CUP + CHA / VPA