From e3f299ac80d42775b7d5fa3fe7b81291aab48d97 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 2 Jul 2024 14:08:21 -0700 Subject: [PATCH] macos: relabel tabs when mergeAllWindows is called Fixes #1902 --- macos/Sources/Features/Terminal/TerminalWindow.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/macos/Sources/Features/Terminal/TerminalWindow.swift b/macos/Sources/Features/Terminal/TerminalWindow.swift index 80abeaca4..d259637ae 100644 --- a/macos/Sources/Features/Terminal/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/TerminalWindow.swift @@ -168,6 +168,16 @@ class TerminalWindow: NSWindow { hideTitleBarSeparators() } } + + override func mergeAllWindows(_ sender: Any?) { + super.mergeAllWindows(sender) + + if let controller = self.windowController as? TerminalController { + // It takes an event loop cycle to merge all the windows so we set a + // short timer to relabel the tabs (issue #1902) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { controller.relabelTabs() } + } + } // MARK: - Tab Bar Styling