From 960aa140276b2a870b69526c964d75d2a8ed100f Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Fri, 12 Jun 2020 14:25:01 -0700 Subject: [PATCH] stop running magics that dont exist (#10894) --- extensions/notebook/src/jupyter/jupyterSessionManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/notebook/src/jupyter/jupyterSessionManager.ts b/extensions/notebook/src/jupyter/jupyterSessionManager.ts index 01b613c973..6d8ab65558 100644 --- a/extensions/notebook/src/jupyter/jupyterSessionManager.ts +++ b/extensions/notebook/src/jupyter/jupyterSessionManager.ts @@ -382,7 +382,8 @@ export class JupyterSession implements nb.ISession { } private async setEnvironmentVars(skip: boolean = false): Promise { - if (!skip && this.sessionImpl) { + // The PowerShell kernel doesn't define the %cd and %set_env magics; no need to run those here then + if (!skip && this.sessionImpl?.kernel?.name !== 'powershell') { let allCode: string = ''; // Ensure cwd matches notebook path (this follows Jupyter behavior) if (this.path && path.dirname(this.path)) {