Skip to content

Commit

Permalink
fix #127901
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge committed Aug 5, 2021
1 parent bd00b1b commit 09be596
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
13 changes: 12 additions & 1 deletion src/vs/workbench/contrib/terminal/browser/terminalEditorInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { dispose, toDisposable } from 'vs/base/common/lifecycle';
import { URI } from 'vs/base/common/uri';
import { IEditorInput } from 'vs/workbench/common/editor';
import { IEditorInput, IUntypedEditorInput } from 'vs/workbench/common/editor';
import { IThemeService, ThemeIcon } from 'vs/platform/theme/common/themeService';
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
import { ITerminalInstance, ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal';
Expand Down Expand Up @@ -194,4 +194,15 @@ export class TerminalEditorInput extends EditorInput {
this._isDetached = true;
}
}

public override toUntyped(): IUntypedEditorInput {
return {
resource: this.resource,
options: {
override: TerminalEditor.ID,
pinned: true,
forceReload: true
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class TerminalEditorService extends Disposable implements ITerminalEditor
const resource = this.resolveResource(instance);
if (resource) {
await this._editorService.openEditor({
resource: URI.revive(resource),
resource,
options:
{
pinned: true,
Expand Down
5 changes: 3 additions & 2 deletions src/vs/workbench/contrib/terminal/browser/terminalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,14 @@ export class TerminalService implements ITerminalService {
}
}
const resolvedResource = this._terminalEditorService.resolveResource(instance || resource);
const editor = this._terminalEditorService.getInputFromResource(resolvedResource) || { editor: URI.revive(resolvedResource) };
const editor = this._terminalEditorService.getInputFromResource(resolvedResource) || { editor: resolvedResource };
return {
editor,
options: {
...options,
pinned: true,
forceReload: true
forceReload: true,
override: TerminalEditor.ID
}
};
});
Expand Down

0 comments on commit 09be596

Please sign in to comment.