[feat] Support applicationShouldTerminate(_:) for macOS graceful shutdown handling
Describe the problem
I’m always frustrated when Tauri applications on macOS do not have a way to gracefully handle app termination requests from the system. Currently, when a user quits the application (via Cmd+Q or pressing the dock icon and then "quit"), the app immediately exits without an opportunity to intercept and prompt the user to save their work or perform cleanup tasks.
Describe the solution you'd like
I would like Tauri to support the applicationShouldTerminate (https://developer.apple.com/documentation/appkit/nsapplicationdelegate/applicationshouldterminate(_:)) delegate method on macOS. This would allow developers to:
- Intercept termination requests
- Prompt users to confirm quitting or save their work (using dialog plugin)
- Perform cleanup tasks before the app exits
- Potentially delay or cancel termination if needed
And no, ExitRequested event in Tauri does not do this. I'm not sure what that is supposed to do tbh.
Alternatives considered
No response
Additional context
No response
I Second this, I also require this feature to be included in tauri as in a lot of cases, this is required. I think i have seen some electron apps do it. i dont know if there any way to do it in tauri currently, so i request for the feature too.
closing in favor of the older #9198