diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index c284c8aed67..0d8614131be 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -282,7 +282,7 @@ export class CodeApplication extends Disposable { } // Resolve shell env - return this.resolveShellEnvironment(args, env); + return this.resolveShellEnvironment(args, env, false); }); ipcMain.handle('vscode:writeNlsFile', (event, path: unknown, data: unknown) => { @@ -990,7 +990,7 @@ export class CodeApplication extends Disposable { // Since this operation can take a long time, we want to warm it up while // the window is opening. // We also show an error to the user in case this fails. - this.resolveShellEnvironment(this.environmentMainService.args, process.env); + this.resolveShellEnvironment(this.environmentMainService.args, process.env, true); // If enable-crash-reporter argv is undefined then this is a fresh start, // based on telemetry.enableCrashreporter settings, generate a UUID which @@ -1022,11 +1022,16 @@ export class CodeApplication extends Disposable { } } - private async resolveShellEnvironment(args: NativeParsedArgs, env: IProcessEnvironment): Promise { + private async resolveShellEnvironment(args: NativeParsedArgs, env: IProcessEnvironment, notifyOnError: boolean): Promise { try { return await resolveShellEnv(this.logService, args, env); } catch (error) { - this.windowsMainService?.sendToFocused('vscode:showResolveShellEnvError', toErrorMessage(error)); + const errorMessage = toErrorMessage(error); + if (notifyOnError) { + this.windowsMainService?.sendToFocused('vscode:showResolveShellEnvError', errorMessage); + } else { + this.logService.error(errorMessage); + } } return {};