MCPcopy
hub / github.com/xtermjs/xterm.js / constructor

Method constructor

src/common/InputHandler.ts:170–382  ·  view source on GitHub ↗
(
    private readonly _bufferService: IBufferService,
    private readonly _charsetService: ICharsetService,
    private readonly _coreService: ICoreService,
    private readonly _logService: ILogService,
    private readonly _optionsService: IOptionsService,
    private readonly _oscLinkService: IOscLinkService,
    private readonly _coreMouseService: ICoreMouseService,
    private readonly _unicodeService: IUnicodeService,
    private readonly _parser: IEscapeSequenceParser = new EscapeSequenceParser()
  )

Source from the content-addressed store, hash-verified

168 };
169
170 constructor(
171 private readonly _bufferService: IBufferService,
172 private readonly _charsetService: ICharsetService,
173 private readonly _coreService: ICoreService,
174 private readonly _logService: ILogService,
175 private readonly _optionsService: IOptionsService,
176 private readonly _oscLinkService: IOscLinkService,
177 private readonly _coreMouseService: ICoreMouseService,
178 private readonly _unicodeService: IUnicodeService,
179 private readonly _parser: IEscapeSequenceParser = new EscapeSequenceParser()
180 ) {
181 super();
182 this._register(this._parser);
183 this._dirtyRowTracker = new DirtyRowTracker(this._bufferService);
184
185 // Track properties used in performance critical code manually to avoid using slow getters
186 this._activeBuffer = this._bufferService.buffer;
187 this._register(this._bufferService.buffers.onBufferActivate(e => this._activeBuffer = e.activeBuffer));
188
189 /**
190 * custom fallback handlers
191 */
192 this._parser.setCsiHandlerFallback((ident, params) => {
193 this._logService.debug('Unknown CSI code: ', { identifier: this._parser.identToString(ident), params: params.toArray() });
194 });
195 this._parser.setEscHandlerFallback(ident => {
196 this._logService.debug('Unknown ESC code: ', { identifier: this._parser.identToString(ident) });
197 });
198 this._parser.setExecuteHandlerFallback(code => {
199 this._logService.debug('Unknown EXECUTE code: ', { code });
200 });
201 this._parser.setOscHandlerFallback((identifier, action, data) => {
202 this._logService.debug('Unknown OSC code: ', { identifier, action, data });
203 });
204 this._parser.setDcsHandlerFallback((ident, action, payload) => {
205 if (action === 'HOOK') {
206 payload = payload.toArray();
207 }
208 this._logService.debug('Unknown DCS code: ', { identifier: this._parser.identToString(ident), action, payload });
209 });
210
211 /**
212 * print handler
213 */
214 this._parser.setPrintHandler((data, start, end) => this.print(data, start, end));
215
216 /**
217 * CSI handler
218 */
219 this._parser.registerCsiHandler({ final: '@' }, params => this.insertChars(params));
220 this._parser.registerCsiHandler({ intermediates: ' ', final: '@' }, params => this.scrollLeft(params));
221 this._parser.registerCsiHandler({ final: 'A' }, params => this.cursorUp(params));
222 this._parser.registerCsiHandler({ intermediates: ' ', final: 'A' }, params => this.scrollRight(params));
223 this._parser.registerCsiHandler({ final: 'B' }, params => this.cursorDown(params));
224 this._parser.registerCsiHandler({ final: 'C' }, params => this.cursorForward(params));
225 this._parser.registerCsiHandler({ final: 'D' }, params => this.cursorBackward(params));
226 this._parser.registerCsiHandler({ final: 'E' }, params => this.cursorNextLine(params));
227 this._parser.registerCsiHandler({ final: 'F' }, params => this.cursorPrecedingLine(params));

Callers

nothing calls this directly

Calls 15

printMethod · 0.95
insertCharsMethod · 0.95
scrollLeftMethod · 0.95
cursorUpMethod · 0.95
scrollRightMethod · 0.95
cursorDownMethod · 0.95
cursorForwardMethod · 0.95
cursorBackwardMethod · 0.95
cursorNextLineMethod · 0.95
cursorPrecedingLineMethod · 0.95
cursorCharAbsoluteMethod · 0.95
cursorPositionMethod · 0.95

Tested by

no test coverage detected