diff --git a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts index 9b0857c9c5cf1..4521abd7ed4f5 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -613,7 +613,10 @@ class SimpleNotebookWorkingCopyEditorHandler extends Disposable implements IWork await this._extensionService.whenInstalledExtensionsRegistered(); this._register(this._workingCopyEditorService.registerHandler({ - handles: workingCopy => typeof this._getViewType(workingCopy) === 'string', + handles: workingCopy => { + const viewType = this._getViewType(workingCopy); + return typeof viewType === 'string' && viewType !== 'interactive'; + }, isOpen: (workingCopy, editor) => editor instanceof NotebookEditorInput && editor.viewType === this._getViewType(workingCopy) && isEqual(workingCopy.resource, editor.resource), createEditor: workingCopy => NotebookEditorInput.create(this._instantiationService, workingCopy.resource, this._getViewType(workingCopy)!) })); diff --git a/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts b/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts index f693c18cafb2f..e3e174aadfb7c 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts @@ -252,8 +252,14 @@ export class NotebookFileWorkingCopyModelFactory implements IStoredFileWorkingCo throw new Error('CANNOT open file notebook with this provider'); } - const bytes = await streamToBuffer(stream); - const data = await info.serializer.dataToNotebook(bytes); + let data: NotebookData = { + metadata: {}, + cells: [] + }; + if (resource.scheme !== Schemas.vscodeInteractive) { + const bytes = await streamToBuffer(stream); + data = await info.serializer.dataToNotebook(bytes); + } if (token.isCancellationRequested) { throw new CancellationError();