Terminal Guide

Get Terminal Title

ESC1B[5B 2132 31 t74

Report the terminal window title.

The terminal replies:

ESC1b ]5d l6c data ESC1b \5c 

Where data usually is the empty string, because this control sequence turned out to be a security hazard.

If explicitly enabled by the user of the terminal some implementations report the window title in data. If enabled with set title mode the string is hex encoded.

urxvt ( 🔧 )

🛆 urxvt always uses ST9c  as terminator instead of ESC1b \5c .

vte ( ✓ )

Source explains:

Report a static window title, since the real window title should NEVER be reported, as it creates a security vulnerability. See http://marc.info/?l=bugtraq&m=104612710031920&w=2 and CVE-2003-0070.