hooks for custom control sequences
This fixes (at least partially) issue #1176 "Add a way to plugin a custom control sequence handler".
This commit is contained in:
+15
-2
@@ -4,7 +4,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IInputHandler, IDcsHandler, IEscapeSequenceParser, IBuffer, IInputHandlingTerminal } from './Types';
|
||||
import { IVtInputHandler, IDcsHandler, IEscapeSequenceParser, IBuffer, IInputHandlingTerminal } from './Types';
|
||||
import { C0, C1 } from './common/data/EscapeSequences';
|
||||
import { CHARSETS, DEFAULT_CHARSET } from './core/data/Charsets';
|
||||
import { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_CODE_INDEX, DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE } from './Buffer';
|
||||
@@ -112,7 +112,7 @@ class DECRQSS implements IDcsHandler {
|
||||
* Refer to http://invisible-island.net/xterm/ctlseqs/ctlseqs.html to understand
|
||||
* each function's header comment.
|
||||
*/
|
||||
export class InputHandler extends Disposable implements IInputHandler {
|
||||
export class InputHandler extends Disposable implements IVtInputHandler {
|
||||
private _surrogateFirst: string;
|
||||
|
||||
constructor(
|
||||
@@ -465,6 +465,19 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
this._terminal.updateRange(buffer.y);
|
||||
}
|
||||
|
||||
addCsiHandler(flag: string, callback: (params: number[], collect: string) => boolean): void {
|
||||
this._parser.addCsiHandler(flag, callback);
|
||||
}
|
||||
removeCsiHandler(flag: string, callback: (params: number[], collect: string) => boolean): void {
|
||||
this._parser.removeCsiHandler(flag, callback);
|
||||
}
|
||||
addOscHandler(ident: number, callback: (data: string) => boolean): void {
|
||||
this._parser.setOscHandler(ident, callback);
|
||||
}
|
||||
removeOscHandler(ident: number, callback: (data: string) => boolean): void {
|
||||
this._parser.removeOscHandler(ident, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* BEL
|
||||
* Bell (Ctrl-G).
|
||||
|
||||
Reference in New Issue
Block a user