From 09246780bb63ef0b2e1040d9fabf7093b774d451 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 11 Sep 2025 14:49:02 -0700 Subject: [PATCH] macos 26: fix visual glitches with moving tabs and titlebar tabs This is a hacky fix to fix some visual glitches when titlebar tabs is on and we're using the `move_tab` keybinding action (I test via the command palette). There is probably a more graceful way to fix this but this might be good enough for a 1.2 to fix a very obviously nasty UI render. --- .../Features/Terminal/TerminalController.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/macos/Sources/Features/Terminal/TerminalController.swift b/macos/Sources/Features/Terminal/TerminalController.swift index bdf3abeb6..4bb642ea6 100644 --- a/macos/Sources/Features/Terminal/TerminalController.swift +++ b/macos/Sources/Features/Terminal/TerminalController.swift @@ -1219,6 +1219,23 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr // Get our target window let targetWindow = tabbedWindows[finalIndex] + + // Moving tabs on macOS 26 RC causes very nasty visual glitches in the titlebar tabs. + // I believe this is due to messed up constraints for our hacky tab bar. I'd like to + // find a better workaround. For now, this improves things dramatically. + // + // Reproduction: titlebar tabs, create two tabs, "move tab left" + if #available(macOS 26, *) { + if window is TitlebarTabsTahoeTerminalWindow { + tabGroup.removeWindow(selectedWindow) + targetWindow.addTabbedWindow(selectedWindow, ordered: action.amount < 0 ? .below : .above) + DispatchQueue.main.async { + selectedWindow.makeKey() + } + + return + } + } // Begin a group of window operations to minimize visual updates NSAnimationContext.beginGrouping()