From 02893dcbb83f4034dd3bd34f5f705b6fdec1ba4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Mon, 7 May 2018 23:28:40 +0200 Subject: [PATCH] fix some docs --- src/EscapeSequenceParser.ts | 8 +++++--- src/InputHandler.ts | 4 ++-- src/Types.ts | 9 +++++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/EscapeSequenceParser.ts b/src/EscapeSequenceParser.ts index 7e71e8b5..dea87f8d 100644 --- a/src/EscapeSequenceParser.ts +++ b/src/EscapeSequenceParser.ts @@ -6,7 +6,7 @@ import { ParserState, ParserAction, IParsingState, IDcsHandler, IEscapeSequenceParser } from './Types'; /** - * Returns an array fulled with numbers between the low and high parameters (inclusive). + * Returns an array filled with numbers between the low and high parameters (right exclusive). * @param low The low number. * @param high The high number. */ @@ -34,7 +34,7 @@ export class TransitionTable { } /** - * Add a new transition to the transition table. + * Add a transition to the transition table. * @param code input character code * @param state current parser state * @param action parser action to be done @@ -45,7 +45,7 @@ export class TransitionTable { } /** - * Add transitions for multiple input characters codes. + * Add transitions for multiple input character codes. * @param codes input character code array * @param state current parser state * @param action parser action to be done @@ -497,6 +497,8 @@ export class EscapeSequenceParser implements IEscapeSequenceParser { break; case ParserAction.OSC_END: if (osc && code !== 0x18 && code !== 0x1a) { + // NOTE: OSC subparsing is not part of the original parser + // we do basic identifier parsing here to offer a jump table for OSC as well let idx = osc.indexOf(';'); if (idx === -1) { this._oscHandlerFb(-1, osc); // this is an error (malformed OSC) diff --git a/src/InputHandler.ts b/src/InputHandler.ts index 16571c66..9dae509d 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -115,7 +115,7 @@ export class InputHandler implements IInputHandler { private _surrogateHigh: string; constructor( - private _terminal: any, + private _terminal: any, // TODO: reestablish IInputHandlingTerminal here private _parser: IEscapeSequenceParser = new EscapeSequenceParser()) { this._surrogateHigh = ''; @@ -1819,7 +1819,7 @@ export class InputHandler implements IInputHandler { /** * OSC 0; ST (set icon name + window title) - * OSC 2; ST (set icon name) + * OSC 2; ST (set window title) * Proxy to set window title. Icon name is not supported. */ public setTitle(data: string): void { diff --git a/src/Types.ts b/src/Types.ts index b1aced5c..5075daa9 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -454,8 +454,13 @@ export interface IParsingState { * EscapeSequenceParser handles DCS commands via separate * subparsers that get hook/unhooked and can handle * arbitrary amount of print data. -* NOTE: EscapeSequenceParser might call `put` several times, -* therefore you have to collect `data` until unhook is called. +* On entering a DSC sequence `hook` is called by +* `EscapeSequenceParser`. Use it to initialize or reset +* states needed to handle the current DCS sequence. +* EscapeSequenceParser will call `put` several times if the +* parsed string got splitted, therefore you might have to collect +* `data` until `unhook` is called. `unhook` marks the end +* of the current DCS sequence. */ export interface IDcsHandler { hook(collect: string, params: number[], flag: number): void;