From a844613a26d4b009326c7ac82e754ab480e656d4 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Fri, 3 Nov 2023 07:34:17 -0700 Subject: [PATCH] macos: always create new window on New Window action Fixes: https://github.com/mitchellh/ghostty/issues/799 --- macos/Sources/Features/Terminal/TerminalManager.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Features/Terminal/TerminalManager.swift b/macos/Sources/Features/Terminal/TerminalManager.swift index e904630be..e5704c833 100644 --- a/macos/Sources/Features/Terminal/TerminalManager.swift +++ b/macos/Sources/Features/Terminal/TerminalManager.swift @@ -95,7 +95,13 @@ class TerminalManager { private func createWindow(withBaseConfig base: Ghostty.SurfaceConfiguration?) -> TerminalController { // Initialize our controller to load the window let c = TerminalController(ghostty, withBaseConfig: base) - + + // For new windows, explicitly disallow tabbing with other windows. + // This overrides the value of userTabbingPreference. Rationale: + // Ghostty provides separate "New Tab" and "New Window" actions so + // there's no reason to make "New Window" open in a tab. + c.window!.tabbingMode = .disallowed; + // Create a listener for when the window is closed so we can remove it. let pubClose = NotificationCenter.default.publisher( for: NSWindow.willCloseNotification,