diff --git a/src/vs/workbench/parts/terminal/common/terminal.ts b/src/vs/workbench/parts/terminal/common/terminal.ts index 48619cd6b408a7fe7cad80666282bd677bf5c897..afde23ca8f76eecfce58ddc0add03cd477225642 100644 --- a/src/vs/workbench/parts/terminal/common/terminal.ts +++ b/src/vs/workbench/parts/terminal/common/terminal.ts @@ -473,7 +473,7 @@ export interface ITerminalProcessManager extends IDisposable { initialCwd: string; addDisposable(disposable: IDisposable); - createProcess(shellLaunchConfig: IShellLaunchConfig); + createProcess(shellLaunchConfig: IShellLaunchConfig, cols: number, rows: number); write(data: string): void; } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index b5c95e73bdec57aa40382f47c8ab8219f3df46c9..67775328ac067c229ae2d6e4bf99fcf305e20290 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -434,7 +434,7 @@ export class TerminalInstance implements ITerminalInstance { } } - get selection(): string | undefined { + public get selection(): string | undefined { return this.hasSelection() ? this._xterm.getSelection() : undefined; } @@ -591,9 +591,9 @@ export class TerminalInstance implements ITerminalInstance { protected _createProcess(): void { // TODO: This should be injected in to the terminal instance (from service?) - this._processManager = this._instantiationService.createInstance(TerminalProcessManager, this._configHelper, this._cols, this._rows); + this._processManager = this._instantiationService.createInstance(TerminalProcessManager, this._configHelper); this._processManager.onShellProcessIdReady(() => this._onProcessIdReady.fire(this)); - this._processManager.createProcess(this._shellLaunchConfig); + this._processManager.createProcess(this._shellLaunchConfig, this._cols, this._rows); if (this._shellLaunchConfig.name) { this.setTitle(this._shellLaunchConfig.name, false); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts index 670789b4de3050f0f199bff610f4f086f7684c65..f721fa85efb03166f303880ee54734accc21a0e8 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts @@ -45,8 +45,6 @@ export class TerminalProcessManager implements ITerminalProcessManager { constructor( private _configHelper: ITerminalConfigHelper, - private _cols: number, - private _rows: number, @IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService, @IHistoryService private readonly _historyService: IHistoryService, @IConfigurationResolverService private readonly _configurationResolverService: IConfigurationResolverService, @@ -63,7 +61,11 @@ export class TerminalProcessManager implements ITerminalProcessManager { this._disposables.push(disposable); } - public createProcess(shellLaunchConfig: IShellLaunchConfig): void { + public createProcess( + shellLaunchConfig: IShellLaunchConfig, + cols: number, + rows: number + ): void { this.ptyProcessReady = new TPromise(c => { this.onShellProcessIdReady(() => { this._logService.debug(`Terminal process ready (shellProcessId: ${this.shellProcessId})`); @@ -92,7 +94,7 @@ export class TerminalProcessManager implements ITerminalProcessManager { // Continue env initialization, merging in the env from the launch // config and adding keys that are needed to create the process - const env = TerminalProcessManager.createTerminalEnv(parentEnv, shellLaunchConfig, this.initialCwd, locale, this._cols, this._rows); + const env = TerminalProcessManager.createTerminalEnv(parentEnv, shellLaunchConfig, this.initialCwd, locale, cols, rows); const cwd = Uri.parse(path.dirname(require.toUrl('../node/terminalProcess'))).fsPath; const options = { env, cwd }; this._logService.debug(`Terminal process launching`, options);