From b29c07adb3aea239ca13d7986a4a813c8f40d8e4 Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Mon, 8 Feb 2021 09:38:06 -0800 Subject: [PATCH] Always use \n when passing to Jupyter (#14185) --- extensions/notebook/src/jupyter/jupyterSessionManager.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/extensions/notebook/src/jupyter/jupyterSessionManager.ts b/extensions/notebook/src/jupyter/jupyterSessionManager.ts index 2d4823edc0..7056677b63 100644 --- a/extensions/notebook/src/jupyter/jupyterSessionManager.ts +++ b/extensions/notebook/src/jupyter/jupyterSessionManager.ts @@ -9,7 +9,6 @@ import * as fs from 'fs-extra'; import * as nls from 'vscode-nls'; import * as vscode from 'vscode'; import * as path from 'path'; -import { EOL } from 'os'; import * as utils from '../common/utils'; const localize = nls.loadMessageBundle(); @@ -364,15 +363,15 @@ export class JupyterSession implements nb.ISession { let allCode: string = ''; // Ensure cwd matches notebook path (this follows Jupyter behavior) if (this.path && path.dirname(this.path)) { - allCode += `%cd ${path.dirname(this.path)}${EOL}`; + allCode += `%cd ${path.dirname(this.path)}\n`; } for (let i = 0; i < Object.keys(process.env).length; i++) { let key = Object.keys(process.env)[i]; if (key.toLowerCase() === 'path' && this._pythonEnvVarPath) { - allCode += `%set_env ${key}=${this._pythonEnvVarPath}${EOL}`; + allCode += `%set_env ${key}=${this._pythonEnvVarPath}\n`; } else { // Jupyter doesn't seem to alow for setting multiple variables at once, so doing it with multiple commands - allCode += `%set_env ${key}=${process.env[key]}${EOL}`; + allCode += `%set_env ${key}=${process.env[key]}\n`; } }