Change:
Testing I feel like I would mostly open output as a "one-off" editor to inspect test failures, for example. Having the prompt whenever I want to close the editor, since it's marked as untitled, is annoying. Instead, should it be opened as an ordinary read-only file which allows the user to if they want to keep it?
do you know how to do this in core? I also want to know how to do it in extensions for a similar problem in luna paint.
You can register an , I do that for test output: Alternatively (and in extensions) you can register a readonly FileSystemProvider.
Thanks, I'm a little surprised there's no option for extensions in as it seems like a common thing people would want to do.

Discussion:
} function getOutputForCommand(command: ICurrentPartialCommand, buffer: IBuffer): string | undefined { <del> const startLine = command.commandStartMarker!.line; </del> <ins> const startLine = command.commandExecutedMarker!.line; </ins> const endLine = command.commandFinishedMarker!.line; let output = ''; <del> for (let i = startLine; i <= endLine; i++) { </del> <ins> for (let i = startLine; i < endLine; i++) { </ins> output += buffer.getLine(i)?.translateToString() + 'n'; } return output === '' ? undefined : output;

import { isFirefox } from 'vs/base/browser/browser'; import { TerminalLinkQuickpick } from 'vs/workbench/contrib/terminal/browser/links/terminalLinkQuickpick'; import { fromNow } from 'vs/base/common/date'; <del> import { ICommandService } from 'vs/platform/commands/common/commands'; </del> import { TerminalCapabilityStoreMultiplexer } from 'vs/workbench/contrib/terminal/common/capabilities/terminalCapabilityStore'; import { TerminalCapability } from 'vs/workbench/contrib/terminal/common/capabilities/capabilities'; <ins> import { ITextModel } from 'vs/editor/common/model'; import { IModelService } from 'vs/editor/common/services/model'; import { ITextModelContentProvider, ITextModelService } from 'vs/editor/common/services/resolverService'; </ins> const enum Constants { /**

const scrollbarHeight = 5; <ins> class TerminalOutputProvider implements ITextModelContentProvider { static scheme = 'TERMINAL_OUTPUT'; constructor( @ITextModelService textModelResolverService: ITextModelService, @IModelService private readonly _modelService: IModelService ) { textModelResolverService.registerTextModelContentProvider(TerminalOutputProvider.scheme, this); } async provideTextContent(resource: URI): Promise<ITextModel | null> { const existing = this._modelService.getModel(resource); if (existing && !existing.isDisposed()) { return existing; } return this._modelService.createModel(resource.fragment, null, resource, false); } } </ins> export class TerminalInstance extends Disposable implements ITerminalInstance { private static _lastKnownCanvasDimensions: ICanvasDimensions | undefined; private static _lastKnownGridDimensions: IGridDimensions | undefined;

@IWorkbenchEnvironmentService workbenchEnvironmentService: IWorkbenchEnvironmentService, @IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService, @IEditorService private readonly _editorService: IEditorService, <del> @IWorkspaceTrustRequestService private readonly _workspaceTrustRequestService: IWorkspaceTrustRequestService, @ICommandService private readonly _commandService: ICommandService </del> <ins> @IWorkspaceTrustRequestService private readonly _workspaceTrustRequestService: IWorkspaceTrustRequestService </ins> ) { super();

items.push({ label }); } } <ins> const outputProvider = this._instantiationService.createInstance(TerminalOutputProvider); </ins> const result = await this._quickInputService.pick(items.reverse(), { onDidTriggerItemButton: (async e => { <del> const output = e.item.command?.getOutput(); if (output) { await this._clipboardService.writeText(output); await this._commandService.executeCommand('workbench.action.files.newUntitledFile'); await this._commandService.executeCommand('editor.action.clipboardPasteAction'); </del> <ins> const selectedCommand = e.item.command; const output = selectedCommand?.getOutput(); if (output && selectedCommand?.command) { const textContent = await outputProvider.provideTextContent(URI.from( { scheme: TerminalOutputProvider.scheme, path: `${selectedCommand.command}... ${fromNow(selectedCommand.timestamp, true)}`, fragment: output, query: `terminal-output-${selectedCommand.timestamp}-${this.instanceId}` })); if (textContent) { this._editorService.openEditor({ resource: textContent.uri }); } </ins> } }) });