Change:
a new notebook (or new image with Luna editor) and also a new text file all the editors dirty hotexit is off the window, selecting "don't save" when prompted to revert all working copies -open the window - the text editor is gone (closed during shut down), but the other editors are open and blank.
This is why I thought the revert behavior was broken in I think it would be much better if an interactive window closed when it was reverted.
this is really up to the editor itself to decide whether to close the editor when the underlying working copy is reverted or not. Generally working copies try to stay as agnostic as possible to editors. There is only very few exceptions when it comes to restoring backups. Untitled editors listen to working copies getting reverted to self-dispose: This in turn, will close the editor. I suggest you go down a similar path. fyi for custom editors
fixed for notebook/Interactive window editor. - did you want another issue to track this for custom editors?
Yes that would be great

Discussion:
readonly onDidSave: Event<IWorkingCopySaveEvent>; readonly onDidChangeOrphaned: Event<void>; readonly onDidChangeReadonly: Event<void>; <ins> readonly onDidRevertUntitled: Event<void>; </ins> readonly resource: URI; readonly viewType: string; readonly notebook: INotebookTextModel | undefined;

} this._register(this._editorModelReference.object.onDidChangeDirty(() => this._onDidChangeDirty.fire())); this._register(this._editorModelReference.object.onDidChangeReadonly(() => this._onDidChangeCapabilities.fire())); <ins> this._register(this._editorModelReference.object.onDidRevertUntitled(() => this.dispose())); </ins> if (this._editorModelReference.object.isDirty()) { this._onDidChangeDirty.fire(); }

import { ICellDto2, INotebookEditorModel, INotebookLoadOptions, IResolvedNotebookEditorModel, NotebookCellsChangeType, NotebookData } from 'vs/workbench/contrib/notebook/common/notebookCommon'; import { INotebookSerializer, INotebookService, SimpleNotebookProviderInfo } from 'vs/workbench/contrib/notebook/common/notebookService'; import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; <del> import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; </del> import { IFileWorkingCopyManager } from 'vs/workbench/services/workingCopy/common/fileWorkingCopyManager'; import { IStoredFileWorkingCopy, IStoredFileWorkingCopyModel, IStoredFileWorkingCopyModelContentChangedEvent, IStoredFileWorkingCopyModelFactory, IStoredFileWorkingCopySaveEvent, StoredFileWorkingCopyState } from 'vs/workbench/services/workingCopy/common/storedFileWorkingCopy'; import { IUntitledFileWorkingCopy, IUntitledFileWorkingCopyModel, IUntitledFileWorkingCopyModelContentChangedEvent, IUntitledFileWorkingCopyModelFactory } from 'vs/workbench/services/workingCopy/common/untitledFileWorkingCopy';

private readonly _onDidSave = this._register(new Emitter<IStoredFileWorkingCopySaveEvent>()); private readonly _onDidChangeOrphaned = this._register(new Emitter<void>()); private readonly _onDidChangeReadonly = this._register(new Emitter<void>()); <ins> private readonly _onDidRevertUntitled = this._register(new Emitter<void>()); </ins> readonly onDidChangeDirty: Event<void> = this._onDidChangeDirty.event; readonly onDidSave: Event<IStoredFileWorkingCopySaveEvent> = this._onDidSave.event; readonly onDidChangeOrphaned: Event<void> = this._onDidChangeOrphaned.event; readonly onDidChangeReadonly: Event<void> = this._onDidChangeReadonly.event; <ins> readonly onDidRevertUntitled: Event<void> = this._onDidRevertUntitled.event; </ins> private _workingCopy?: IStoredFileWorkingCopy<NotebookFileWorkingCopyModel> | IUntitledFileWorkingCopy<NotebookFileWorkingCopyModel>; private readonly _workingCopyListeners = this._register(new DisposableStore());

private readonly _hasAssociatedFilePath: boolean, readonly viewType: string, private readonly _workingCopyManager: IFileWorkingCopyManager<NotebookFileWorkingCopyModel, NotebookFileWorkingCopyModel>, <del> @ILifecycleService lifecycleService: ILifecycleService, </del> @IFilesConfigurationService private readonly _filesConfigurationService: IFilesConfigurationService ) { super();

} else { this._workingCopy = await this._workingCopyManager.resolve({ untitledResource: this.resource, isScratchpad: this.scratchPad }); } <ins> this._workingCopy.onDidRevert(() => this._onDidRevertUntitled.fire()); </ins> } else { this._workingCopy = await this._workingCopyManager.resolve(this.resource, options?.forceReadFromFile ? { reload: { async: false, force: true } } : undefined); this._workingCopyListeners.add(this._workingCopy.onDidSave(e => this._onDidSave.fire(e)));

readonly onDidChangeOrphaned = Event.None; readonly onDidChangeReadonly = Event.None; <ins> readonly onDidRevertUntitled = Event.None; </ins> private readonly _onDidChangeContent = this._register(new Emitter<void>()); readonly onDidChangeContent: Event<void> = this._onDidChangeContent.event;