stop running magics that dont exist (#10894)

This commit is contained in:
Chris LaFreniere
2020-06-12 14:25:01 -07:00
committed by GitHub
parent 3608e132cb
commit 960aa14027

View File

@@ -382,7 +382,8 @@ export class JupyterSession implements nb.ISession {
}
private async setEnvironmentVars(skip: boolean = false): Promise<void> {
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)) {