Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/terminal/browser/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ export interface ITerminalEditorService extends ITerminalInstanceHost {

openEditor(instance: ITerminalInstance, editorOptions?: TerminalEditorLocation): Promise<void>;
detachInstance(instance: ITerminalInstance): void;
splitInstance(instanceToSplit: ITerminalInstance, shellLaunchConfig?: IShellLaunchConfig): ITerminalInstance;
splitInstance(instanceToSplit: ITerminalInstance, shellLaunchConfig?: IShellLaunchConfig): Promise<ITerminalInstance>;
revealActiveEditor(preserveFocus?: boolean): Promise<void>;
resolveResource(instance: ITerminalInstance): URI;
reviveInput(deserializedInput: IDeserializedTerminalEditorInput): EditorInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class TerminalEditorService extends Disposable implements ITerminalEditor
return getInstanceFromResource(this.instances, resource);
}

splitInstance(instanceToSplit: ITerminalInstance, shellLaunchConfig: IShellLaunchConfig = {}): ITerminalInstance {
async splitInstance(instanceToSplit: ITerminalInstance, shellLaunchConfig: IShellLaunchConfig = {}): Promise<ITerminalInstance> {
if (instanceToSplit.target === TerminalLocation.Editor) {
// Make sure the instance to split's group is active
const group = this._editorInputs.get(instanceToSplit.resource.path)?.group;
Expand All @@ -223,7 +223,7 @@ export class TerminalEditorService extends Disposable implements ITerminalEditor
const instance = this._terminalInstanceService.createInstance(shellLaunchConfig, TerminalLocation.Editor);
const resource = this.resolveResource(instance);
if (resource) {
this._editorService.openEditor({
await this._editorService.openEditor({
resource: URI.revive(resource),
description: instance.description,
options: {
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/terminal/browser/terminalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ export class TerminalService extends Disposable implements ITerminalService {
this._extensionService.activateByEvent('onTerminal:*');
let instance;
if (parent) {
instance = this._splitTerminal(shellLaunchConfig, location, parent);
instance = await this._splitTerminal(shellLaunchConfig, location, parent);
} else {
instance = this._createTerminal(shellLaunchConfig, location, options);
}
Expand Down Expand Up @@ -1135,7 +1135,7 @@ export class TerminalService extends Disposable implements ITerminalService {
}
}

private _splitTerminal(shellLaunchConfig: IShellLaunchConfig, location: TerminalLocation, parent: ITerminalInstance): ITerminalInstance {
private async _splitTerminal(shellLaunchConfig: IShellLaunchConfig, location: TerminalLocation, parent: ITerminalInstance): Promise<ITerminalInstance> {
let instance;
// Use the URI from the base instance if it exists, this will correctly split local terminals
if (typeof shellLaunchConfig.cwd !== 'object' && typeof parent.shellLaunchConfig.cwd === 'object') {
Expand All @@ -1146,7 +1146,7 @@ export class TerminalService extends Disposable implements ITerminalService {
});
}
if (location === TerminalLocation.Editor || parent.target === TerminalLocation.Editor) {
instance = this._terminalEditorService.splitInstance(parent, shellLaunchConfig);
instance = await this._terminalEditorService.splitInstance(parent, shellLaunchConfig);
} else {
const group = this._terminalGroupService.getGroupForInstance(parent);
if (!group) {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/test/browser/workbenchTestServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ export class TestTerminalEditorService implements ITerminalEditorService {
onDidChangeInstances = Event.None;
openEditor(instance: ITerminalInstance, editorOptions?: TerminalEditorLocation): Promise<void> { throw new Error('Method not implemented.'); }
detachInstance(instance: ITerminalInstance): void { throw new Error('Method not implemented.'); }
splitInstance(instanceToSplit: ITerminalInstance, shellLaunchConfig?: IShellLaunchConfig): ITerminalInstance { throw new Error('Method not implemented.'); }
splitInstance(instanceToSplit: ITerminalInstance, shellLaunchConfig?: IShellLaunchConfig): Promise<ITerminalInstance> { throw new Error('Method not implemented.'); }
revealActiveEditor(preserveFocus?: boolean): Promise<void> { throw new Error('Method not implemented.'); }
resolveResource(instance: ITerminalInstance): URI { throw new Error('Method not implemented.'); }
reviveInput(deserializedInput: IDeserializedTerminalEditorInput): TerminalEditorInput { throw new Error('Method not implemented.'); }
Expand Down