Skip to content

Commit 22e4a2d

Browse files
committed
Merge branch 'master' into reuse_bufferlines
2 parents e9906f9 + 160b4a7 commit 22e4a2d

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/InputHandler.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@ const GLEVEL: {[key: string]: number} = {'(': 0, ')': 1, '*': 2, '+': 3, '-': 1,
2424
* DCS subparser implementations
2525
*/
2626

27+
/**
28+
* DCS + q Pt ST (xterm)
29+
* Request Terminfo String
30+
* not supported
31+
*/
32+
class RequestTerminfo implements IDcsHandler {
33+
private _data: string;
34+
constructor(private _terminal: any) { }
35+
hook(collect: string, params: number[], flag: number): void {
36+
this._data = '';
37+
}
38+
put(data: string, start: number, end: number): void {
39+
this._data += data.substring(start, end);
40+
}
41+
unhook(): void {
42+
// invalid: DCS 0 + r Pt ST
43+
this._terminal.handler(`${C0.ESC}P0+r${this._data}${C0.ESC}\\`);
44+
}
45+
}
46+
2747
/**
2848
* DCS $ q Pt ST
2949
* DECRQSS (https://vt100.net/docs/vt510-rm/DECRQSS.html)
@@ -66,7 +86,7 @@ class DECRQSS implements IDcsHandler {
6686
default:
6787
// invalid: DCS 0 $ r Pt ST (xterm)
6888
this._terminal.error('Unknown DCS $q %s', this._data);
69-
this._terminal.handler(`${C0.ESC}P0$r${C0.ESC}\\`);
89+
this._terminal.handler(`${C0.ESC}P0$r${this._data}${C0.ESC}\\`);
7090
}
7191
}
7292
}
@@ -267,6 +287,7 @@ export class InputHandler extends Disposable implements IInputHandler {
267287
* DCS handler
268288
*/
269289
this._parser.setDcsHandler('$q', new DECRQSS(this._terminal));
290+
this._parser.setDcsHandler('+q', new RequestTerminfo(this._terminal));
270291
}
271292

272293
public dispose(): void {

0 commit comments

Comments
 (0)