diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index eea4190baed..31e31018b5e 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -118,7 +118,7 @@ export function createApiFactory( const extHostFileSystem = rpcProtocol.set(ExtHostContext.ExtHostFileSystem, new ExtHostFileSystem(rpcProtocol, extHostLanguageFeatures)); const extHostFileSystemEvent = rpcProtocol.set(ExtHostContext.ExtHostFileSystemEventService, new ExtHostFileSystemEventService(rpcProtocol, extHostDocumentsAndEditors)); const extHostQuickOpen = rpcProtocol.set(ExtHostContext.ExtHostQuickOpen, new ExtHostQuickOpen(rpcProtocol, extHostWorkspace, extHostCommands)); - const extHostTerminalService = rpcProtocol.set(ExtHostContext.ExtHostTerminalService, new ExtHostTerminalService(rpcProtocol, extHostConfiguration, extHostLogService)); + const extHostTerminalService = rpcProtocol.set(ExtHostContext.ExtHostTerminalService, new ExtHostTerminalService(rpcProtocol, extHostConfiguration)); const extHostDebugService = rpcProtocol.set(ExtHostContext.ExtHostDebugService, new ExtHostDebugService(rpcProtocol, extHostWorkspace, extensionService, extHostDocumentsAndEditors, extHostConfiguration, extHostTerminalService)); const extHostSCM = rpcProtocol.set(ExtHostContext.ExtHostSCM, new ExtHostSCM(rpcProtocol, extHostCommands, extHostLogService)); const extHostSearch = rpcProtocol.set(ExtHostContext.ExtHostSearch, new ExtHostSearch(rpcProtocol, schemeTransformer)); diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 0d65e360428..dc52bfc0023 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -7,12 +7,12 @@ import * as vscode from 'vscode'; import * as os from 'os'; import * as platform from 'vs/base/common/platform'; -import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; -import Uri from 'vs/base/common/uri'; +// import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; +// import Uri from 'vs/base/common/uri'; import { Event, Emitter } from 'vs/base/common/event'; import { ExtHostTerminalServiceShape, MainContext, MainThreadTerminalServiceShape, IMainContext, ShellLaunchConfigDto } from 'vs/workbench/api/node/extHost.protocol'; import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration'; -import { ILogService } from 'vs/platform/log/common/log'; +// import { ILogService } from 'vs/platform/log/common/log'; import { EXT_HOST_CREATION_DELAY } from 'vs/workbench/parts/terminal/common/terminal'; import { TerminalProcess } from 'vs/workbench/parts/terminal/node/terminalProcess'; @@ -241,7 +241,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { constructor( mainContext: IMainContext, private _extHostConfiguration: ExtHostConfiguration, - private _logService: ILogService + // private _logService: ILogService ) { this._proxy = mainContext.getProxy(MainContext.MainThreadTerminalService); } @@ -358,7 +358,8 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { const terminalConfig = this._extHostConfiguration.getConfiguration('terminal.integrated'); - const locale = terminalConfig.get('setLocaleVariables') ? platform.locale : undefined; + // TODO: Move locale into TerminalProcess + // const locale = terminalConfig.get('setLocaleVariables') ? platform.locale : undefined; if (!shellLaunchConfig.executable) { // TODO: This duplicates some of TerminalConfigHelper.mergeDefaultShellPathAndArgs and should be merged // this._configHelper.mergeDefaultShellPathAndArgs(shellLaunchConfig); @@ -385,18 +386,17 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { // shellLaunchConfig.env = envFromShell; // Merge process env with the env from config - const parentEnv = { ...process.env }; + // const parentEnv = { ...process.env }; // terminalEnvironment.mergeEnvironments(parentEnv, envFromConfig); // Continue env initialization, merging in the env from the launch // config and adding keys that are needed to create the process - const env = terminalEnvironment.createTerminalEnv(parentEnv, shellLaunchConfig, initialCwd, locale, cols, rows); - const cwd = Uri.parse(require.toUrl('../../parts/terminal/node')).fsPath; - const options = { env, cwd, execArgv: [] }; + // const env = terminalEnvironment.createTerminalEnv(parentEnv, shellLaunchConfig, initialCwd, locale, cols, rows); + // const options = { env, cwd, execArgv: [] }; // Fork the process and listen for messages - this._logService.debug(`Terminal process launching on ext host`, options); - this._terminalProcesses[id] = new TerminalProcess(shellLaunchConfig.executable, shellLaunchConfig.args, cwd, cols, rows); + // this._logService.debug(`Terminal process launching on ext host`, options); + this._terminalProcesses[id] = new TerminalProcess(shellLaunchConfig.executable, shellLaunchConfig.args, initialCwd, cols, rows); this._terminalProcesses[id].onProcessIdReady(pid => this._proxy.$sendProcessPid(id, pid)); this._terminalProcesses[id].onProcessTitleChanged(title => this._proxy.$sendProcessTitle(id, title)); this._terminalProcesses[id].onProcessData(data => this._proxy.$sendProcessData(id, data)); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts index 6519252e734..b276f5620c7 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts @@ -96,6 +96,7 @@ export class TerminalProcessManager implements ITerminalProcessManager { if (extensionHostOwned) { this._process = this._instantiationService.createInstance(TerminalProcessExtHostProxy, this._terminalId, shellLaunchConfig, cols, rows); } else { + // TODO: Move locale into TerminalProcess const locale = this._configHelper.config.setLocaleVariables ? platform.locale : undefined; if (!shellLaunchConfig.executable) { this._configHelper.mergeDefaultShellPathAndArgs(shellLaunchConfig); @@ -113,6 +114,7 @@ export class TerminalProcessManager implements ITerminalProcessManager { // Merge process env with the env from config const parentEnv = { ...process.env }; + // TODO: Move environment merge stuff into TerminalProcess terminalEnvironment.mergeEnvironments(parentEnv, envFromConfig); // Continue env initialization, merging in the env from the launch @@ -123,7 +125,8 @@ export class TerminalProcessManager implements ITerminalProcessManager { this._logService.debug(`Terminal process launching`, options); // TODO: Send right args (on ext host too) - this._process = new TerminalProcess(env['PTYSHELL'], [], env['PTYCWD'], cols, rows); + console.log('create terminal process', env['PTYSHELL'], env['PTYCWD']); + this._process = new TerminalProcess(shellLaunchConfig.executable, shellLaunchConfig.args, this.initialCwd, cols, rows); } this.processState = ProcessState.LAUNCHING;