-
Notifications
You must be signed in to change notification settings - Fork 40
Description
when i open the demo app in this repo on my local machine, this line gets printed on top of the terminal:
warning: fish could not read response to Primary Device Attribute query after waiting for 2 seconds. This is often due to a missing feature in your terminal. See 'help terminal-compatibility' or 'man fish-terminal-compatibility'. This fish process will no longer wait for outstanding queries, which disables some optional features.
as you can see, my default terminal is fish (version 4.2.1 on macos).
i investigated this issue and as far as i can tell it's because fish is sending a DA1 query sequence and we're dropping it in the wasm patch here.
since this repo intends to be a drop in replacement for xterm.js, this is the relevant implementation in their repo (link)
/**
* CSI Ps c Send Device Attributes (Primary DA).
* Ps = 0 or omitted -> request attributes from terminal. The
* response depends on the decTerminalID resource setting.
* -> CSI ? 1 ; 2 c (``VT100 with Advanced Video Option'')
* -> CSI ? 1 ; 0 c (``VT101 with No Options'')
* -> CSI ? 6 c (``VT102'')
* -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c (``VT220'')
* The VT100-style response parameters do not mean anything by
* themselves. VT220 parameters do, telling the host what fea-
* tures the terminal supports:
* Ps = 1 -> 132-columns.
* Ps = 2 -> Printer.
* Ps = 6 -> Selective erase.
* Ps = 8 -> User-defined keys.
* Ps = 9 -> National replacement character sets.
* Ps = 1 5 -> Technical characters.
* Ps = 2 2 -> ANSI color, e.g., VT525.
* Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode).
*
* @vt: #Y CSI DA1 "Primary Device Attributes" "CSI c" "Send primary device attributes."
*
*
* TODO: fix and cleanup response
*/
public sendDeviceAttributesPrimary(params: IParams): boolean {
if (params.params[0] > 0) {
return true;
}
if (this._is('xterm') || this._is('rxvt-unicode') || this._is('screen')) {
this._coreService.triggerDataEvent(C0.ESC + '[?1;2c');
} else if (this._is('linux')) {
this._coreService.triggerDataEvent(C0.ESC + '[?6c');
}
return true;
}
/**
* CSI > Ps c
* Send Device Attributes (Secondary DA).
* Ps = 0 or omitted -> request the terminal's identification
* code. The response depends on the decTerminalID resource set-
* ting. It should apply only to VT220 and up, but xterm extends
* this to VT100.
* -> CSI > Pp ; Pv ; Pc c
* where Pp denotes the terminal type
* Pp = 0 -> ``VT100''.
* Pp = 1 -> ``VT220''.
* and Pv is the firmware version (for xterm, this was originally
* the XFree86 patch number, starting with 95). In a DEC termi-
* nal, Pc indicates the ROM cartridge registration number and is
* always zero.
* More information:
* xterm/charproc.c - line 2012, for more information.
* vim responds with ^[[?0c or ^[[?1c after the terminal's response (?)
*
* @vt: #Y CSI DA2 "Secondary Device Attributes" "CSI > c" "Send primary device attributes."
*
*
* TODO: fix and cleanup response
*/
public sendDeviceAttributesSecondary(params: IParams): boolean {
if (params.params[0] > 0) {
return true;
}
// xterm and urxvt
// seem to spit this
// out around ~370 times (?).
if (this._is('xterm')) {
this._coreService.triggerDataEvent(C0.ESC + '[>0;276;0c');
} else if (this._is('rxvt-unicode')) {
this._coreService.triggerDataEvent(C0.ESC + '[>85;95;0c');
} else if (this._is('linux')) {
// not supported by linux console.
// linux console echoes parameters.
this._coreService.triggerDataEvent(params.params[0] + 'c');
} else if (this._is('screen')) {
this._coreService.triggerDataEvent(C0.ESC + '[>83;40003;0c');
}
return true;
}