summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiangbao Meng <134181853+bo2themax@users.noreply.github.com>2025-10-10 18:31:55 +0200
committerGitHub <noreply@github.com>2025-10-10 09:31:55 -0700
commitc8ea42b8943e2fb49aa68bdeaaf695eb493b95be (patch)
treec8534a9f34264410d0d72e6a6daeee5d38ffc0d2
parent207eccffda019f11e87d2af7c0a98c9223b228b7 (diff)
macOS: Fix New Tab behaviours (#9124)
- Fix `macos-dock-drop-behavior = new-tab` not working, which also affects `open /path/to/directory -a Ghostty.app` - Fix 'New Tab' in dock icon not working **when Ghostty's not active** ### Issue preview with `1.2.2(12187)` https://github.com/user-attachments/assets/18068cc2-c25d-4360-97ab-cec22d5d3ff4
-rw-r--r--macos/Sources/App/macOS/AppDelegate.swift13
1 files changed, 10 insertions, 3 deletions
diff --git a/macos/Sources/App/macOS/AppDelegate.swift b/macos/Sources/App/macOS/AppDelegate.swift
index 3eff7b3e4..6f387f4ae 100644
--- a/macos/Sources/App/macOS/AppDelegate.swift
+++ b/macos/Sources/App/macOS/AppDelegate.swift
@@ -465,7 +465,12 @@ class AppDelegate: NSObject,
}
switch ghostty.config.macosDockDropBehavior {
- case .new_tab: _ = TerminalController.newTab(ghostty, withBaseConfig: config)
+ case .new_tab:
+ _ = TerminalController.newTab(
+ ghostty,
+ from: TerminalController.preferredParent?.window,
+ withBaseConfig: config
+ )
case .new_window: _ = TerminalController.newWindow(ghostty, withBaseConfig: config)
}
@@ -1002,13 +1007,15 @@ class AppDelegate: NSObject,
//UpdateSimulator.happyPath.simulate(with: updateViewModel)
}
-
@IBAction func newWindow(_ sender: Any?) {
_ = TerminalController.newWindow(ghostty)
}
@IBAction func newTab(_ sender: Any?) {
- _ = TerminalController.newTab(ghostty)
+ _ = TerminalController.newTab(
+ ghostty,
+ from: TerminalController.preferredParent?.window
+ )
}
@IBAction func closeAllWindows(_ sender: Any?) {