diff --git a/tabby-core/src/components/baseTab.component.ts b/tabby-core/src/components/baseTab.component.ts index 71d15cda..19536b53 100644 --- a/tabby-core/src/components/baseTab.component.ts +++ b/tabby-core/src/components/baseTab.component.ts @@ -192,6 +192,14 @@ export abstract class BaseTabComponent extends BaseComponent { this.viewContainer = undefined } + get topmostParent (): BaseTabComponent|null { + let parent = this.parent + while (parent?.parent) { + parent = parent.parent + } + return parent + } + /** * Called before the tab is closed */ diff --git a/tabby-core/src/components/splitTab.component.ts b/tabby-core/src/components/splitTab.component.ts index 4dd2db8a..07ac3b46 100644 --- a/tabby-core/src/components/splitTab.component.ts +++ b/tabby-core/src/components/splitTab.component.ts @@ -458,12 +458,18 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit tab.destroy() } + let allTabs: BaseTabComponent[] = [] if (thing instanceof BaseTabComponent) { - if (thing.parent instanceof SplitTabComponent) { - thing.parent.removeTab(thing) + allTabs = [thing] + } else if (thing instanceof SplitContainer) { + allTabs = thing.getAllTabs() + } + for (const tab of allTabs) { + if (tab.parent instanceof SplitTabComponent) { + tab.parent.removeTab(tab) } - thing.removeFromContainer() - thing.parent = this + tab.removeFromContainer() + tab.parent = this } let target = relative ? this.getParentOf(relative) : null diff --git a/tabby-terminal/src/components/terminalToolbar.component.scss b/tabby-terminal/src/components/terminalToolbar.component.scss index 79bca1ce..874c4a5c 100644 --- a/tabby-terminal/src/components/terminalToolbar.component.scss +++ b/tabby-terminal/src/components/terminalToolbar.component.scss @@ -2,6 +2,7 @@ padding: 5px 15px 5px 15px; display: flex; z-index: 3; + overflow: hidden; ::ng-deep .btn { white-space: nowrap; diff --git a/tabby-terminal/src/components/terminalToolbar.component.ts b/tabby-terminal/src/components/terminalToolbar.component.ts index c47059ba..6962269a 100644 --- a/tabby-terminal/src/components/terminalToolbar.component.ts +++ b/tabby-terminal/src/components/terminalToolbar.component.ts @@ -29,7 +29,7 @@ export class TerminalToolbarComponent { } get shouldShowDragHandle (): boolean { - return this.tab.parent instanceof SplitTabComponent && this.tab.parent.getAllTabs().length > 1 + return this.tab.topmostParent instanceof SplitTabComponent && this.tab.topmostParent.getAllTabs().length > 1 } @HostListener('mouseenter') onMouseEnter () {