From d826dfd943dee16d2dab7a1b0b6c6d07ec40f1ae Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Fri, 19 Jul 2019 11:19:00 -0700 Subject: [PATCH] Allow remote error messages to work --- src/vs/workbench/api/browser/mainThreadTerminalService.ts | 7 +++++++ src/vs/workbench/api/common/extHost.protocol.ts | 3 ++- src/vs/workbench/api/node/extHostTerminalService.ts | 1 + .../workbench/contrib/terminal/browser/terminalInstance.ts | 1 + src/vs/workbench/contrib/terminal/common/terminal.ts | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadTerminalService.ts b/src/vs/workbench/api/browser/mainThreadTerminalService.ts index ab865cc5224..d1cdcc4c131 100644 --- a/src/vs/workbench/api/browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/browser/mainThreadTerminalService.ts @@ -323,6 +323,13 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape this._getTerminalProcess(terminalId).then(e => e.emitCwd(cwd)); } + public $sendResolvedLaunchConfig(terminalId: number, shellLaunchConfig: IShellLaunchConfig): void { + const instance = this._terminalService.getInstanceFromId(terminalId); + if (instance) { + instance.shellLaunchConfig = shellLaunchConfig; + } + } + private async _onRequestLatency(terminalId: number): Promise { const COUNT = 2; let sum = 0; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index d1f9840554d..cde31c599a3 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -42,7 +42,7 @@ import { IRevealOptions, ITreeItem } from 'vs/workbench/common/views'; import * as callHierarchy from 'vs/workbench/contrib/callHierarchy/common/callHierarchy'; import { IAdapterDescriptor, IConfig, ITerminalSettings } from 'vs/workbench/contrib/debug/common/debug'; import { ITextQueryBuilderOptions } from 'vs/workbench/contrib/search/common/queryBuilder'; -import { ITerminalDimensions } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ITerminalDimensions, IShellLaunchConfig } from 'vs/workbench/contrib/terminal/common/terminal'; import { ExtensionActivationError } from 'vs/workbench/services/extensions/common/extensions'; import { createExtHostContextProxyIdentifier as createExtId, createMainContextProxyIdentifier as createMainId, IRPCProtocol } from 'vs/workbench/services/extensions/common/proxyIdentifier'; import * as search from 'vs/workbench/services/search/common/search'; @@ -404,6 +404,7 @@ export interface MainThreadTerminalServiceShape extends IDisposable { $sendOverrideDimensions(terminalId: number, dimensions: ITerminalDimensions | undefined): void; $sendProcessInitialCwd(terminalId: number, cwd: string): void; $sendProcessCwd(terminalId: number, initialCwd: string): void; + $sendResolvedLaunchConfig(terminalId: number, shellLaunchConfig: IShellLaunchConfig): void; // Renderer $terminalRendererSetName(terminalId: number, name: string): void; diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 37044a2f362..55942c11733 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -617,6 +617,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { // TODO: Support conpty on remote, it doesn't seem to work for some reason? // TODO: When conpty is enabled, only enable it when accessibilityMode is off const enableConpty = false; //terminalConfig.get('windowsEnableConpty') as boolean; + this._proxy.$sendResolvedLaunchConfig(id, shellLaunchConfig); this._setupExtHostProcessListeners(id, new TerminalProcess(shellLaunchConfig, initialCwd, cols, rows, env, enableConpty, this._logService)); } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 1dc49e0e242..1e385d4c223 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -223,6 +223,7 @@ export class TerminalInstance implements ITerminalInstance { public get hadFocusOnExit(): boolean { return this._hadFocusOnExit; } public get isTitleSetByProcess(): boolean { return !!this._messageTitleDisposable; } public get shellLaunchConfig(): IShellLaunchConfig { return this._shellLaunchConfig; } + public set shellLaunchConfig(shellLaunchConfig: IShellLaunchConfig) { this._shellLaunchConfig = shellLaunchConfig; } public get commandTracker(): TerminalCommandTracker { return this._commandTracker; } private readonly _onExit = new Emitter(); diff --git a/src/vs/workbench/contrib/terminal/common/terminal.ts b/src/vs/workbench/contrib/terminal/common/terminal.ts index c126bf70978..02825b35a22 100644 --- a/src/vs/workbench/contrib/terminal/common/terminal.ts +++ b/src/vs/workbench/contrib/terminal/common/terminal.ts @@ -468,7 +468,7 @@ export interface ITerminalInstance { /** * The shell launch config used to launch the shell. */ - readonly shellLaunchConfig: IShellLaunchConfig; + shellLaunchConfig: IShellLaunchConfig; /** * Whether to disable layout for the terminal. This is useful when the size of the terminal is -- GitLab