Terminal identification escape sequence
Hi
After some discussion, xterm, mintty, iTerm2 and tmux have added an escape sequence to report the terminal emulator name and version. This will be supported in the next releases from each.
The sequence chosen is:
request = CSI > q
or CSI > 0 q
reply = DCS > | text ST
Where text
is freeform name and version, within the rules for what can appear in DCS
. For example:
$ printf '\033[>q'; cat
^[P>|iTerm2 3.3.20200425-nightly^[\
This feature is useful to allow applications to detect the terminal emulator and enable other features automatically, for example enabling RGB colour even if the system does not yet have the xterm-direct
terminfo entry or the user has neglected to change TERM
. This improves user experience and reduces configuration.
Some applications already try to detect the terminal with a mixture of the existing device attributes escape sequences, guesses based on TERM
, and environment variables like VTE_VERSION
, but these are complex and inconsistently supported across terminal emulators.
See the long discussion here, https://github.com/mintty/mintty/issues/881, which has multiple points of view on this.
It would be useful to have this sequence in VTE, particularly since VTE has: 1) been among the first terminal emulators to introduce a number of extensions in recent years 2) uses xterm
for TERM
3) currently lacks a convenient a way to identify it and its version with an escape sequence 4) already offers its version to applications with VTE_VERSION
despite the disadvantages of environment variables.
Here is a patch to add this to VTE: vte-xda-q.diff.txt
Thanks