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
| Field | Description |
|---|---|
x | Horizontal pixel position from the left edge of the screen |
y | Vertical 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 withCSI 3 ; x ; y twherexandyare 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 sameCSI 3 ; x ; y tformat, 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
| Specification | Section |
|---|---|
| XTerm ctlseqs | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✗ | No | Rejected per escape_support.md:81-82 |
| Bobcat | ✓ | 0.9.0 | Requires WindowReports enabled in profile |
| contour | ✗ | No | Not implemented in WINDOWMANIP handler |
| foot | ~ | Yes | CSI 13 t always reports (0,0) - doesn't know actual position |
| Ghostty | ✗ | No | CSI 13 t not implemented |
| iTerm2 | ✓ | v20260216-nightly | CSI 13 t via XTERMCC_REPORT_WIN_POS |
| Kitty | ✗ | No | CSI 13 t not supported |
| Konsole | ✗ | No | CSI 13 t not implemented |
| mintty | ✓ | Yes | CSI 13 t implemented |
| mlterm | ✓ | rel-3_8_0 | CSI 13 t reports fixed 0,0 |
| PuTTY | ✓ | 0.75 | CSI 13 t supported at terminal.c:4924-4930 |
| Rio | ✗ | No | |
| rxvt-unicode | ✓ | 1.2 | |
| st | ✗ | No | No CSI t window manipulation sequences implemented |
| terminology | ✗ | No | |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | Replies with fixed origin 0,0 |
| WezTerm | ✗ | No | Parsed but handled as unimplemented |
| Windows Terminal | ✗ | No | CSI 13 t not in WindowManipulationType enum |
| xterm | ✓ | xterm-93 | |
| xterm.js | ✓ | 4.4.0 | CSI 13 t. Requires windowOptions.getWinPosition enabled. |
| Multiplexers | |||
| cy | ✗ | No | Explicitly ignored |
| GNU Screen | ✗ | No | CSI 13 t not implemented |
| tmux | ✗ | No | Sequence parsed but ignored (case 13 in winops) |
| tuios | ✗ | No | CSI 13 t not handled |
| Zellij | ✗ | No | |
See also
- Move Window — Move window to a pixel position
- Window State Report — Query whether the window is iconified
- Text Area Size (pixels) — Query text area pixel dimensions