Merge pull request #2569 from Tyriar/layers6

Move WindowsMode to common/
This commit is contained in:
Daniel Imms
2019-11-15 10:27:55 -08:00
committed by GitHub
2 changed files with 16 additions and 13 deletions
+9 -5
View File
@@ -43,7 +43,7 @@ import { IKeyboardEvent, KeyboardResultType, ICharset, IBufferLine, IAttributeDa
import { evaluateKeyboardEvent } from 'common/input/Keyboard';
import { EventEmitter, IEvent } from 'common/EventEmitter';
import { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
import { applyWindowsMode } from './WindowsMode';
import { handleWindowsModeLineFeed } from 'common/WindowsMode';
import { ColorManager } from 'browser/ColorManager';
import { RenderService } from 'browser/services/RenderService';
import { IOptionsService, IBufferService, ICoreMouseService, ICoreService, ILogService, IDirtyRowService, IInstantiationService } from 'common/services/Services';
@@ -284,7 +284,13 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
this.linkifier = this.linkifier || new Linkifier(this._bufferService, this._logService);
if (this.options.windowsMode) {
this._windowsMode = applyWindowsMode(this);
this._enableWindowsMode();
}
}
private _enableWindowsMode(): void {
if (!this._windowsMode) {
this._windowsMode = this.onLineFeed(handleWindowsModeLineFeed.bind(null, this._bufferService));
}
}
@@ -366,9 +372,7 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
break;
case 'windowsMode':
if (this.optionsService.options.windowsMode) {
if (!this._windowsMode) {
this._windowsMode = applyWindowsMode(this);
}
this._enableWindowsMode();
} else {
this._windowsMode?.dispose();
this._windowsMode = undefined;