Skip to content

XTVERSION support #5342

@ryancdotorg

Description

@ryancdotorg

This has been requested for other terminal emulators, e.g. vercel/hyper#5940 microsoft/terminal#18382

Since the TERM string is ambiguous, and feature probing is incomplete (for example, detecting 24 bit color support) it would be useful for xterm.js to identify itself in response to

CSI > q and CSI > 0 q

Looks like the relevant hooks in InputHandler.ts would look like

this._parser.registerCsiHandler({ prefix: '>', final: 'q' }, params => this.sendXtVersion(params));
public sendXtVersion(params: IParams): boolean {
    if (params.params[0] > 0) {
        return true;
    }

    this._coreService.triggerDataEvent(C0.ESC + `P>|xterm.js(${code to get version number goes here})`);

    return true;
}

The version number doesn't seem to be currently present in a way xterm.js can access it at runtime, so it would need to be injected somewhere as part of the build process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions