Skip to main content

Position report

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!
Experimental

Window Position Report is an XTerm window manipulation sequence that queries the pixel position of the terminal window on the screen.

Syntax​

CSI 13 t               Request window position
CSI 13 ; 2 t Request text area position
CSI 3 ; x ; y t Response: pixel position
Formal syntax
(* Request — window position *)
position_request      = 0x1b, "[", "1", "3", "t" ;

(* Request — text area position *)
text_area_pos_request = 0x1b, "[", "1", "3", ";", "2", "t" ;

(* Response *)
position_response     = 0x1b, "[", "3", ";", Pn, ";", Pn, "t" ;
Pn                    = digit, { digit } ;
digit                 = "0" | "1" | "2" | "3" | "4"
                    | "5" | "6" | "7" | "8" | "9" ;

Response​

FieldDescription
xHorizontal pixel position from the left edge of the screen
yVertical pixel position from the top edge of the screen

Description​

This sequence queries the terminal for the pixel position of the window on the screen. It is part of the XTerm CSI Ps ; Ps ; Ps t window manipulation family.

  • CSI 13 t — Requests the position of the terminal window. The terminal responds with CSI 3 ; x ; y t where x and y are the pixel coordinates of the top-left corner of the window.
  • CSI 13 ; 2 t — Requests the position of the text area (the region where characters are rendered, excluding window decorations). The terminal responds with the same CSI 3 ; x ; y t format, but with the coordinates of the text area's top-left corner.

The coordinate system uses the screen's origin (0, 0) at the top-left corner, with x increasing to the right and y increasing downward. The response format matches the parameter format of the Move Window sequence (CSI 3 ; x ; y t).

Examples​

# Query window position
printf '\e[13t'

# Query text area position
printf '\e[13;2t'

# Read the response
printf '\e[13t'; read -st 1 -d t response; echo "$response"

Specifications​

SpecificationSection
XTerm ctlseqs—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✗NoRejected per escape_support.md:81-82
Bobcat✓0.9.0Requires WindowReports enabled in profile
contour✗NoNot implemented in WINDOWMANIP handler
foot~YesCSI 13 t always reports (0,0) - doesn't know actual position
Ghostty✗NoCSI 13 t not implemented
iTerm2✓v20260216-nightlyCSI 13 t via XTERMCC_REPORT_WIN_POS
Kitty✗NoCSI 13 t not supported
Konsole✗NoCSI 13 t not implemented
mintty✓YesCSI 13 t implemented
mlterm✓rel-3_8_0CSI 13 t reports fixed 0,0
PuTTY✓0.75CSI 13 t supported at terminal.c:4924-4930
Rio✗No
rxvt-unicode✓1.2
st✗NoNo CSI t window manipulation sequences implemented
terminology✗No
VT100✗No
VTE✓YesReplies with fixed origin 0,0
WezTerm✗NoParsed but handled as unimplemented
Windows Terminal✗NoCSI 13 t not in WindowManipulationType enum
xterm✓xterm-93
xterm.js✓4.4.0CSI 13 t. Requires windowOptions.getWinPosition enabled.
Multiplexers
cy✗NoExplicitly ignored
GNU Screen✗NoCSI 13 t not implemented
tmux✗NoSequence parsed but ignored (case 13 in winops)
tuios✗NoCSI 13 t not handled
Zellij✗No

See also​