Skip to content

Commit a7247ca

Browse files
committed
open panel when terminal gets moved there from editor
1 parent 158b9b3 commit a7247ca

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/vs/workbench/contrib/terminal/browser/terminal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export interface ITerminalGroupService extends ITerminalInstanceHost, ITerminalF
251251

252252
setContainer(container: HTMLElement): void;
253253

254-
showPanel(focus?: boolean): Promise<void>;
254+
showPanel(focus?: boolean, force?: boolean): Promise<void>;
255255
hidePanel(): void;
256256
focusTabs(): void;
257257
showTabs(): void;

src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,20 +163,20 @@ export class TerminalGroupService extends Disposable implements ITerminalGroupSe
163163
return group;
164164
}
165165

166-
async showPanel(focus?: boolean): Promise<void> {
167-
if (this._configHelper.config.defaultLocation !== TerminalLocation.Editor) {
166+
async showPanel(focus?: boolean, force?: boolean): Promise<void> {
167+
if (this._configHelper.config.defaultLocation !== TerminalLocation.Editor || force) {
168168
const pane = this._viewsService.getActiveViewWithId(TERMINAL_VIEW_ID)
169169
?? await this._viewsService.openView(TERMINAL_VIEW_ID, focus);
170170
pane?.setExpanded(true);
171-
}
172171

173-
if (focus) {
174-
// Do the focus call asynchronously as going through the
175-
// command palette will force editor focus
176-
await timeout(0);
177-
const instance = this.activeInstance;
178-
if (instance) {
179-
await instance.focusWhenReady(true);
172+
if (focus) {
173+
// Do the focus call asynchronously as going through the
174+
// command palette will force editor focus
175+
await timeout(0);
176+
const instance = this.activeInstance;
177+
if (instance) {
178+
await instance.focusWhenReady(true);
179+
}
180180
}
181181
}
182182
}

src/vs/workbench/contrib/terminal/browser/terminalService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ export class TerminalService implements ITerminalService {
695695
// Fire events
696696
this._onDidChangeInstances.fire();
697697
this._onActiveGroupChanged.fire(this._terminalGroupService.activeGroup);
698+
this._terminalGroupService.showPanel(true, true);
698699
}
699700

700701
protected _initInstanceListeners(instance: ITerminalInstance): void {

0 commit comments

Comments
 (0)