Skip to content

Commit

Permalink
Revert "Remove request term info handler"
Browse files Browse the repository at this point in the history
This reverts commit c2994b0.
  • Loading branch information
Tyriar committed Oct 30, 2018
1 parent f3cd652 commit 160b4a7
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/InputHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ const GLEVEL: {[key: string]: number} = {'(': 0, ')': 1, '*': 2, '+': 3, '-': 1,
* DCS subparser implementations
*/

/**
* DCS + q Pt ST (xterm)
* Request Terminfo String
* not supported
*/
class RequestTerminfo implements IDcsHandler {
private _data: string;
constructor(private _terminal: any) { }
hook(collect: string, params: number[], flag: number): void {
this._data = '';
}
put(data: string, start: number, end: number): void {
this._data += data.substring(start, end);
}
unhook(): void {
// invalid: DCS 0 + r Pt ST
this._terminal.handler(`${C0.ESC}P0+r${this._data}${C0.ESC}\\`);
}
}

/**
* DCS $ q Pt ST
* DECRQSS (https://vt100.net/docs/vt510-rm/DECRQSS.html)
Expand Down Expand Up @@ -66,7 +86,7 @@ class DECRQSS implements IDcsHandler {
default:
// invalid: DCS 0 $ r Pt ST (xterm)
this._terminal.error('Unknown DCS $q %s', this._data);
this._terminal.handler(`${C0.ESC}P0$r${C0.ESC}\\`);
this._terminal.handler(`${C0.ESC}P0$r${this._data}${C0.ESC}\\`);
}
}
}
Expand Down Expand Up @@ -267,6 +287,7 @@ export class InputHandler extends Disposable implements IInputHandler {
* DCS handler
*/
this._parser.setDcsHandler('$q', new DECRQSS(this._terminal));
this._parser.setDcsHandler('+q', new RequestTerminfo(this._terminal));
}

public dispose(): void {
Expand Down

0 comments on commit 160b4a7

Please sign in to comment.