Skip to content

Please report XTVERSION in response to CSI > 0 q or set TERM to something other than xterm (or both) #18382

Description

@chaosemer

Description of the new feature

Ideally I think Windows Terminal would set the environment variable TERM to a unique value and also update the existing terminfo databases. However, I understand that the intermediate state that creates where many programs don't recognize the new terminal type is undesirable.

So in the meantime, can Windows Terminal report XTVERSION? From ctlseqs:

CSI > Ps q
            Ps = 0  ⇒  Report xterm name and version (XTVERSION).
          The response is a DSR sequence identifying the version:
            DCS > | text ST

This escape sequence is pretty widely supported to send a unique string that identifies the name and version of a terminal. Off the top of my head, VTE-based terminals (such as GNOME Terminal), Konsole, iTerm2, WezTerm, Contour, and kitty all support this escape sequence.

Context: I am currently drafting up a patch to Emacs that will rely either TERM or XTVERSION to determine if xterm-mouse-mode is safe to be enabled by default. Emacs wants to see support fo OSC52 copy, bracketed paste, DECSET1000, and DECSET1003 at a minimum and checking XTVERSION or TERM is the only way I have to identify if these escape sequences are supported. Also see Emacs discussion thread.

Proposed technical implementation details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-VTVirtual Terminal sequence supportIssue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Needs-Tag-FixDoesn't match tag requirementsNot-Standards-TrackPriority-3A description (P3)Product-TerminalThe new Windows Terminal.

    Projects

    Status
    Spec Needed ❓

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions