Terminal Guide

Report Terminal Window Position

ESC1B[5B 1331 33 ;3b cmd t74
urxvt
xterm
🔧
vte
🔧
konsole
cmd = 0

Report terminal window position.

The terminal replies with

ESC1b [5b 333 ;3b xpos ;3b ypos t74 

Where xpos is the x position of the terminal window and ypos is the y position.

If cmd = 2 then the position is the position of the inner top-left corner of the window decorations.

urxvt ( ✓ )

🛈 Behaves always as if cmd = 2. 🛆 Windows with negative coordinates generated output with '-' which creates invalid CSI sequences.

xterm ( 🔧 )

🛆 Windows with negative coordinates generated output with wrapped values (using 16bit)

vte ( 🔧 )

🛆 Always returns 0, 0 since vte 0.58 🛆 Before 0.58: At least with gnome-terminal as embeder xpos sometimes wraps around to something close to 65500.(https://gitlab.gnome.org/GNOME/vte/issues/128)