MCPcopy
hub / github.com/PowerShell/vscode-powershell / restartSession

Method restartSession

src/session.ts:351–370  ·  view source on GitHub ↗
(exeNameOverride?: string)

Source from the content-addressed store, hash-verified

349 }
350
351 private async restartSession(exeNameOverride?: string): Promise<void> {
352 this.logger.write("Restarting session...");
353 await this.stop();
354
355 // Re-load the settings.
356 this.sessionSettings = getSettings();
357
358 if (exeNameOverride) {
359 // Reset the version and PowerShell details since we're launching a
360 // new executable.
361 this.logger.writeDebug(
362 `Starting with executable overriden to: ${exeNameOverride}`,
363 );
364 this.sessionSettings.powerShellDefaultVersion = exeNameOverride;
365 this.versionDetails = undefined;
366 this.PowerShellExeDetails = undefined;
367 }
368
369 await this.start();
370 }
371
372 /** In Development mode, write the PID to a file where the parent session can find it, to attach the dotnet debugger. */
373 private async writePidIfInDevMode(

Callers 5

restartWithPromptMethod · 0.95
registerCommandsMethod · 0.95
promptForRestartMethod · 0.95
showSessionMenuMethod · 0.95

Calls 5

stopMethod · 0.95
startMethod · 0.95
getSettingsFunction · 0.90
writeMethod · 0.65
writeDebugMethod · 0.65

Tested by

no test coverage detected