From 0241623d2724ca06bc7e98bb5d4ea31445e9968e Mon Sep 17 00:00:00 2001 From: Eugene Date: Sat, 24 Aug 2024 13:05:05 +0200 Subject: [PATCH] fixed #9829 - show the active pane's title as the first in the split tab title --- tabby-core/src/components/splitTab.component.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tabby-core/src/components/splitTab.component.ts b/tabby-core/src/components/splitTab.component.ts index 1e4f4c29..936dd0e4 100644 --- a/tabby-core/src/components/splitTab.component.ts +++ b/tabby-core/src/components/splitTab.component.ts @@ -821,7 +821,13 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit if (this.disableDynamicTitle) { return } - this.setTitle([...new Set(this.getAllTabs().map(x => x.title))].join(' | ')) + const titles = [ + this.getFocusedTab()?.title, + ...this.getAllTabs() + .filter(x => x !== this.getFocusedTab()) + .map(x => x.title), + ] + this.setTitle([...new Set(titles)].join(' | ')) } private attachTabView (tab: BaseTabComponent) { @@ -837,6 +843,10 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit }) } + tab.subscribeUntilDestroyed( + this.observeUntilChildDetached(tab, tab.focused$), + () => this.updateTitle(), + ) tab.subscribeUntilDestroyed( this.observeUntilChildDetached(tab, tab.titleChange$), () => this.updateTitle(),