X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=blobdiff_plain;f=node_modules%2Fxterm%2Fsrc%2Fcommon%2Fservices%2FCoreService.ts;fp=node_modules%2Fxterm%2Fsrc%2Fcommon%2Fservices%2FCoreService.ts;h=0000000000000000000000000000000000000000;hp=0e0ba60917fcbdfbeb8ccdd1a32080a8327410a7;hb=5e96dd57ddd883604e87f62bdddcb111c63a6e1a;hpb=acb5f682a2b75b972710cabd81658f63071324b0 diff --git a/node_modules/xterm/src/common/services/CoreService.ts b/node_modules/xterm/src/common/services/CoreService.ts deleted file mode 100644 index 0e0ba60..0000000 --- a/node_modules/xterm/src/common/services/CoreService.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2019 The xterm.js authors. All rights reserved. - * @license MIT - */ - -import { ICoreService, ILogService, IOptionsService, IBufferService } from 'common/services/Services'; -import { EventEmitter, IEvent } from 'common/EventEmitter'; -import { IDecPrivateModes } from 'common/Types'; -import { clone } from 'common/Clone'; - -const DEFAULT_DEC_PRIVATE_MODES: IDecPrivateModes = Object.freeze({ - applicationCursorKeys: false -}); - -export class CoreService implements ICoreService { - serviceBrand: any; - - public decPrivateModes: IDecPrivateModes; - - private _onData = new EventEmitter(); - public get onData(): IEvent { return this._onData.event; } - private _onUserInput = new EventEmitter(); - public get onUserInput(): IEvent { return this._onUserInput.event; } - - constructor( - // TODO: Move this into a service - private readonly _scrollToBottom: () => void, - @IBufferService private readonly _bufferService: IBufferService, - @ILogService private readonly _logService: ILogService, - @IOptionsService private readonly _optionsService: IOptionsService - ) { - this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES); - } - - public reset(): void { - this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES); - } - - public triggerDataEvent(data: string, wasUserInput: boolean = false): void { - // Prevents all events to pty process if stdin is disabled - if (this._optionsService.options.disableStdin) { - return; - } - - // Input is being sent to the terminal, the terminal should focus the prompt. - const buffer = this._bufferService.buffer; - if (buffer.ybase !== buffer.ydisp) { - this._scrollToBottom(); - } - - // Fire onUserInput so listeners can react as well (eg. clear selection) - if (wasUserInput) { - this._onUserInput.fire(); - } - - // Fire onData API - this._logService.debug(`sending data "${data}"`, () => data.split('').map(e => e.charCodeAt(0))); - this._onData.fire(data); - } -}