diff --git a/CHANGELOG.md b/CHANGELOG.md index 8db19843d850..4205ac52f62d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ ([#11334](https://github.com/Microsoft/vscode-python/issues/11334)) 1. Change "python.dataScience.runStartupCommands" commands to be a global setting, not a workspace setting. ([#11352](https://github.com/Microsoft/vscode-python/issues/11352)) +1. Closing the interactive window shuts down other active notebook sessions. + ([#11404](https://github.com/Microsoft/vscode-python/issues/11404)) ### Thanks diff --git a/src/client/datascience/interactive-common/notebookProvider.ts b/src/client/datascience/interactive-common/notebookProvider.ts index 13b896d3de39..c7e48fdb4667 100644 --- a/src/client/datascience/interactive-common/notebookProvider.ts +++ b/src/client/datascience/interactive-common/notebookProvider.ts @@ -281,7 +281,13 @@ export class NotebookProvider implements INotebookProvider { } Array.from(this.notebooks.values()).forEach((promise) => { - promise.then((notebook) => notebook.dispose()).catch(noop); + promise + .then((notebook) => { + if (notebook.identity.scheme === 'history') { + notebook.dispose().ignoreErrors(); + } + }) + .catch(noop); }); this.notebooks.clear();