From 3d6d83950e6acabe71ca8a561ca5dc7e04efa7ec Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 5 Jul 2023 14:15:59 -0700 Subject: [PATCH] Don't spawn pty host on getDefaultSystemShell or refreshIgnoreProcessNames --- src/vs/platform/terminal/node/ptyHostService.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vs/platform/terminal/node/ptyHostService.ts b/src/vs/platform/terminal/node/ptyHostService.ts index ad7dd4be94d..ecd550e3826 100644 --- a/src/vs/platform/terminal/node/ptyHostService.ts +++ b/src/vs/platform/terminal/node/ptyHostService.ts @@ -5,7 +5,7 @@ import { Emitter, Event } from 'vs/base/common/event'; import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IProcessEnvironment, OperatingSystem, isWindows } from 'vs/base/common/platform'; +import { IProcessEnvironment, OS, OperatingSystem, isWindows } from 'vs/base/common/platform'; import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService, ILoggerService, LogLevel } from 'vs/platform/log/common/log'; @@ -19,6 +19,7 @@ import { IGetTerminalLayoutInfoArgs, IProcessDetails, ISetTerminalLayoutInfoArgs import { IPtyHostConnection, IPtyHostStarter } from 'vs/platform/terminal/node/ptyHost'; import { detectAvailableProfiles } from 'vs/platform/terminal/node/terminalProfiles'; import * as performance from 'vs/base/common/performance'; +import { getSystemShell } from 'vs/base/node/shell'; enum Constants { MaxRestarts = 5 @@ -122,7 +123,7 @@ export class PtyHostService extends Disposable implements IPtyService { } private async _refreshIgnoreProcessNames(): Promise { - return this._proxy.refreshIgnoreProcessNames?.(this._ignoreProcessNames); + return this._optionalProxy?.refreshIgnoreProcessNames?.(this._ignoreProcessNames); } private async _resolveShellEnv(): Promise { @@ -286,7 +287,7 @@ export class PtyHostService extends Disposable implements IPtyService { } getDefaultSystemShell(osOverride?: OperatingSystem): Promise { - return this._proxy.getDefaultSystemShell(osOverride); + return this._optionalProxy?.getDefaultSystemShell(osOverride) ?? getSystemShell(osOverride ?? OS, process.env); } async getProfiles(workspaceId: string, profiles: unknown, defaultProfile: unknown, includeDetectedProfiles: boolean = false): Promise { const shellEnv = await this._resolveShellEnv();