cleanup DCS handler
This commit is contained in:
+7
-24
@@ -27,28 +27,6 @@ const GLEVEL: {[key: string]: number} = {'(': 0, ')': 1, '*': 2, '+': 3, '-': 1,
|
|||||||
* DCS subparser implementations
|
* DCS subparser implementations
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* DCS + q Pt ST (xterm)
|
|
||||||
* Request Terminfo String
|
|
||||||
* not supported
|
|
||||||
*/
|
|
||||||
class RequestTerminfo implements IDcsHandler {
|
|
||||||
private _data: Uint32Array = new Uint32Array(0);
|
|
||||||
constructor(private _terminal: any) { }
|
|
||||||
hook(collect: string, params: number[], flag: number): void {
|
|
||||||
this._data = new Uint32Array(0);
|
|
||||||
}
|
|
||||||
put(data: Uint32Array, start: number, end: number): void {
|
|
||||||
this._data = concat(this._data, data.subarray(start, end));
|
|
||||||
}
|
|
||||||
unhook(): void {
|
|
||||||
const data = utf32ToString(this._data);
|
|
||||||
this._data = new Uint32Array(0);
|
|
||||||
// invalid: DCS 0 + r Pt ST
|
|
||||||
this._terminal.handler(`${C0.ESC}P0+r${data}${C0.ESC}\\`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DCS $ q Pt ST
|
* DCS $ q Pt ST
|
||||||
* DECRQSS (https://vt100.net/docs/vt510-rm/DECRQSS.html)
|
* DECRQSS (https://vt100.net/docs/vt510-rm/DECRQSS.html)
|
||||||
@@ -92,7 +70,7 @@ class DECRQSS implements IDcsHandler {
|
|||||||
default:
|
default:
|
||||||
// invalid: DCS 0 $ r Pt ST (xterm)
|
// invalid: DCS 0 $ r Pt ST (xterm)
|
||||||
this._terminal.error('Unknown DCS $q %s', data);
|
this._terminal.error('Unknown DCS $q %s', data);
|
||||||
this._terminal.handler(`${C0.ESC}P0$r${data}${C0.ESC}\\`);
|
this._terminal.handler(`${C0.ESC}P0$r${C0.ESC}\\`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,6 +81,12 @@ class DECRQSS implements IDcsHandler {
|
|||||||
* not supported
|
* not supported
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DCS + q Pt ST (xterm)
|
||||||
|
* Request Terminfo String
|
||||||
|
* not implemented
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DCS + p Pt ST (xterm)
|
* DCS + p Pt ST (xterm)
|
||||||
* Set Terminfo Data
|
* Set Terminfo Data
|
||||||
@@ -292,7 +276,6 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|||||||
* DCS handler
|
* DCS handler
|
||||||
*/
|
*/
|
||||||
this._parser.setDcsHandler('$q', new DECRQSS(this._terminal));
|
this._parser.setDcsHandler('$q', new DECRQSS(this._terminal));
|
||||||
this._parser.setDcsHandler('+q', new RequestTerminfo(this._terminal));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user