From d8e71ecfbf0217dc072016f8d2bf96b0d7727df3 Mon Sep 17 00:00:00 2001 From: Fedor Korotkov Date: Fri, 23 Jan 2026 20:01:47 +0100 Subject: [PATCH] Fix VM window not appearing on tart run Restore the applicationDidFinishLaunching method that was accidentally removed in commit b1e88e1 ("tart run: do not remove 'Edit' menu as its not present anymore"). That commit intended to remove the Edit menu removal code (since the menu no longer exists), but also removed the crucial activation code: - setActivationPolicy(.regular) - tells macOS this is a GUI app - activate(ignoringOtherApps:) - brings the window to the foreground Without these calls, the VM runs fine (SSH works) but no window appears on screen. Fixes #1181 Co-Authored-By: Claude Opus 4.5 --- Sources/tart/Commands/Run.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/tart/Commands/Run.swift b/Sources/tart/Commands/Run.swift index 736916d..2b19aa5 100644 --- a/Sources/tart/Commands/Run.swift +++ b/Sources/tart/Commands/Run.swift @@ -819,6 +819,12 @@ struct MainApp: App { } class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject { + func applicationDidFinishLaunching(_ : Notification) { + let nsApp = NSApplication.shared + nsApp.setActivationPolicy(.regular) + nsApp.activate(ignoringOtherApps: true) + } + func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply { if (kill(getpid(), MainApp.suspendable ? SIGUSR1 : SIGINT) == 0) { return .terminateLater