Swift Quit – Automatic App Quitting on Mac
swiftquit.com
swiftquit.com
Back in 2010 when I got my first MacBook, the app not closing when the window closed was alien to me as someone who had only ever used Windows. But that discomfort only lasted a few months, and I grew to strongly prefer the distinction of “this app is running” and “this app is has a window open” + value the difference between Cmd-Q and Cmd-W.
I remember one OS update made the app closing behavior the default, and I had to go learn where the setting was to undo it; a subsequent OS backtracked on that. The distinction is less meaningful these days with NVME making apps launch much faster than spinning 2.5” drives, but stuff like Photoshop still has a long startup time.
I switched to Mac 20 years ago (when I started a decade-long stint as software engineer at Apple), and I still DETEST this behavior. Why the hell do I want some application that I just "closed" to continue owning the menu? Of course, this indicts the Mac's single menu bar, glued to the top of the screen. That mistake should have been fixed with the transition to OS X, but nope.
A related issue is Apple's half-assed implementation of Alt-Tab-style app switching. I was pretty impressed that they added this Windows-style feature, but less so after finding that it doesn't restore minimized apps. Again, why do I want to switch back to an app but not restore its UI? Fortunately there's a utility for that: Alt-Tab. https://alt-tab-macos.netlify.app
It can also create a window for applications that lack them when you switch to them; this is a huge boon for Finder.
In the category of "single window apps", I wouldn't want my music to stop playing just because the gui of spotify is not visible. Granted, Hide might be a better option than closing the window, depending on if the app being active is useful without the gui. With spotify in particular, I would expect space to act as a play/pause even without gui visible, though annoyingly it seems they have not implemented it like that (apple music does).
Nor have I encountered music apps ceasing playback just because their window is minimized... with one exception: Apple Music stops playback if you minimize it when a music video is playing.
I think the issue on Macs is down to Apple forcing all applications to share a single menu, instead of putting the menu on the application's main window frame the way every other GUI evolved to. A single menu glued to the top of the screen reduces your entire desktop to one application's client area, instead of an open workspace for many applications. This weakness has historically degraded the Mac's multi-monitor experience too.
Fortunately, most Mac apps have finally abandoned their penchant for barfing out a flotilla of windows all over the screen, and gone to a modern single-window design.
Apple has attempted several workarounds for the window-management problem, like "Exposė" and "Stage Manager" and "Mission Control." The first thing I do with a new Mac OS install is disable all those irritating hotkeys... and STILL find windows randomly zooming out to a gallery sometimes.
When you get used to it, it’s jarring to go back to Windows and realize you don’t even know the name of an unfamiliar app that is open much less which one will be alt-f4’d if you were to press it.
Nowadays it's easier to navigate menus with keyboard than pointing device.
People citing 'Fitt's law" to defend this dumb menu design love to ignore the big D in that "law." And what does the D stand for? DISTANCE.
Fitt's law dictates that the menu should be on the application's main frame, because that's closer to where the user is working (thus minimizing D). That's more true today than ever, as screen sizes and resolutions have reached new heights.
Knowing which app has focus does not require the entire system to be limited to a single menu. It simply requires proper visual feedback to SHOW the user which window (and attached menu) is active.
This, pre-SSDs, used to be a much, much bigger deal. Now it's not as big a deal, but if you've been using Macs for 20 years surely you've felt the difference between opening a window of an already-open app vs opening an app from scratch.
I personally love that I can have all the apps I want permanently open on my Mac, and never have to experience the delay of anything launching. A new window just pops up instantly when I wanna interact with an app. It's great.
It's annoying when you momentarily check a new E-mail message, minimize Mail, and then try to zoom the Web page you're looking at... only to find that it doesn't work because Mail still has control of the menu. And to fix that you have to click on the browser's window, which is a hypocritical admission that the GUI is the expected means of interacting with an application.
I much more frequently quickly check an email, close it, and then want to send a new email than I want to change the zoom on a web page as my next action.
The zoom example was only that: an example of an attempt to interact with the "active" application on the screen that fails because the menu does not correspond to the application that's being shown.
Feel free to replace the Mail-&-browser example with two applications that YOU might want to bounce between.
So what?
It's a different model to what you are used to and IMHO more flexible and powerful. If you try and keep operating in a manner learned on a different model you will inevitably be frustrated.
There has been no evidence provided to show how this design is "more flexible and powerful," since all the same options exist on Windows, which ALSO offers other options that require half the steps to achieve app-switching.
I haven’t minimised a window in months. For those special needs, there’s expose.
You haven't dismissed the application; you've closed or minimized a document. The application is still active.
- If an app is open, load times for new windows are instantaneous; I have a M2 and the difference between a new window for an app that's open and launching an app is still pretty noticeable for most apps. It's definitely noticeable on my Windows PC, and it's mildly annoying.
- I don't have to keep track of what's running: A new or main window for a frequently-used app is always just Cmd-Tab, Cmd+N/0/whatever, regardless of whether I already have five windows open or none at all. Allows me to keep the dock hidden too since I typically don't need to see what's running and what isn't.
- Cmd+Tab is more like a context-sensitive window launcher than a list of windows for me, one that I can navigate quickly by keyboard; select an app, hit h for hide, q for quit, up-arrow to see all its windows. If I might need an app, like CaptureOne, it's in the Dock; if I'm actually likely to need it, like Mail, it'll be in Cmd+Tab (possibly autostarted), add/remove from/to the latter is really low-friction (Cmd+Space, Cmd+Q), macOS optimizes resource usage so running apps don't bog down the machine. I find that a lot more useful than the simple list of windows I get via Windows Alt+Tab. Grouping windows per app keeps the size of that list manageable, though there are cases when that gets in the way somewhat. That's true for Alt+Tab too, it gets crowded real quick, requiring a lot more tab-ing.
- Another advantage of the macOS paradigm: Less background agents; seems every other app on Windows has one. By far not as frequent on macOS since you don't necessarily need a background service to speed up starting times or run updates; I see those things mostly in apps that have been sloppily transplanted from Windows, or that actually need to do meaningful work when the app isn't running, like Little Snitch.
- Cmd+Tab does restore hidden windows, just not minimized ones. A distinction that Windows doesn't have, IIRC, but one that I find useful. Cmd+H is for getting things out of sight, minimize is for getting things out of the way completely. Windows minimize is more like hide, but for individual windows.
- I like the single menu bar; every app has one, and it's always in the same place, and it's always the foremost app's and even if I don't have an active window right now, I can still run updates, open files, open windows, ... without a launcher screen or similar cludges. I think Windows integrates something similar into a task icon popup these days. I've noticed many modern Windows apps have their own ideas about what a menu should look like, how you access it, whether you need one in the first place, whether you should be able to navigate it by keyboard. IIRC even Office does that, not a fan. On macOS you can assign a keyboard shortcut to every menu item of any app via System Preferences, you can search menu items, there are apps that render nice overlays with the available functionality and keyboard shortcuts based on the menus, all of that's up to the individual app on Windows (and it seems most are moving towards mouse-only navigation there). The macOS menu system is also pretty neat for accessibility and automation. I've built apps (not for wider distribution) that consisted of just the menu and didn't even have a real UI, because that's enough for some things, super quick and easy to build from non-Apple languages, and trivial to automate.
You seem to feel like macOS should be a carbon copy of Windows w.r.t. window management, but it's not, macOS apps are pretty different conceptually than Windows applications, and different states are supposed to mean different things, interactions aren't supposed to work the same, different compromises in a lot of places. Both approaches work and have a theoretical underpinning that I think is sound, it's just different, and I think it's nice to have options. You want the Windows way of doing things? I guess Windows is always going to do the best job at being Windows, so use that? Unless you're still at Apple, then I guess you're out of luck.
> It can also create a window for applications that lack them when you switch to them; this is a huge boon for Finder.
I agree it's annoying that Finder doesn't do this (somehow it's almost the only app where that behaviour annoys me). I probably could do something like that in Hammerspoon, too. Hmmmm.
Most of what you cite here isn't dependent on the single-menu design, however. Application startup time, the way things are listed in Alt-Tab galleries, "background agents..." Valid beefs, perhaps, but none is related to the single-menu issue.
"I like the single menu bar; every app has one, and it's always in the same place, and it's always the foremost app's"
That's simply not true. I can have one application on my Mac screen, Safari, and yet the menu belongs to Mail. That's just dumb.
You do correctly call out one of the (sadly plentiful) regressions in Windows: the sudden deletion of the standard menu from many applications' window frames. It was just as "findable" as the Mac's for most of Windows's existence, but now it's just often... missing. WTF? The Office UI is an absolute shitshow, and the rest of Windows has been circling the drain for years.
Therefore no, I don't think the Mac should be a copy of Windows. I just hate the single-menu design and the pervasive UI clumsiness that has emanated from it. Any mode of operation it offers can also be offered by any other windowing GUI, minus of course the glued-in-place single menu... actually, you can mimic even that by maximizing your applications and Alt-Tabbing between them.
> That's simply not true. I can have one application on my Mac screen, Safari, and yet the menu belongs to Mail. That's just dumb.
Right, it's the one belonging to the active application, not the foremost one (though, most often, the two will be the same). On Windows, an application and its main UI are very tightly coupled; macOS sees the two as separate entities, and I think Mail is a good example for an app where that totally makes sense, since that way I can open a new e-mail dialog without going through the main UI; just Cmd+Tab to Mail, Cmd+N, or Cmd+0 if I need the main UI, and if I don't explicitly close it or minimize it (and Cmd+H instead or just Cmd+Tab back to the browser or whatever) it'll come right up when I Cmd+Tab to Mail. I think that's a pretty smart way of doing things.
Similarly, with Finder, I can just hit Cmd+K for the "Connect to Server" dialog, Enter, and I'm on my NAS since it remembers the last server address. No unneeded Explorer window popping up, no mouse required, pretty quick. I can close the current browser window and keep a minimized window with a few tabs I'll need for an activity later this evening, because the browser doesn't have to have a UI just to be active. Those tabs sit down there and out of the way, but I still have them and their state. Windows would force the minimized window to the foreground when I Alt+Tab to the browser, and it's hard to think of a system-wide scheme that does what you want, but still allows for this. I think actually the macOS paradigm is quite a bit more flexible.
> Therefore no, I don't think the Mac should be a copy of Windows. I just hate the single-menu design and the pervasive UI clumsiness that has emanated from it.
How tightly an app and its UI are coupled has nothing to do with the single menubar. It does sound like you have a very strong preference for the way Windows does things, and you expect things to work that way, and where they don't, you hate that. Why don't you just stick with Windows? After all, the great thing about having options is that I can have the macOS way and you can have the Windows way and we can all be happy.
Just like a terminal isn’t an OS, a function isn’t a program, a web page isn’t a web site.
Being able to deal with each independently has value.
That makes it EASIER to deal with "each independently."
Here's a story from when I was using Windows for work after using Macs for ages. I had one folder in Sublime Text open, and I wanted to close that window and then open another one. So I hit the [X] button in the corner, which closed the window, and then I instinctively went to the global menu bar at the top of the screen to go to 'File › Open' to open my new window. But of course, it wasn't there, because closing the window also got rid of my ability to access the menu bar.
And then I opened Sublime Text again, and it re-opened with the old window I wanted to get rid of.
This is why, like others in this thread, I've grown to really like the application-vs-window separation. Having a menu bar on each window, and having programs close themselves when they get down to zero windows, means I have to do my operations in a certain order (I have to open my second window before I can close the first one, I can't do it in either order) and use a UI hierarchy that I don't think makes sense (I have to use the menu bar of an existing window to open a new window, even though that operation has nothing to do with that window's contents).
When I have used Windows (and it's a fair amount), I am often annoyed to have an app that I thought was in the Taskbar gone. The cognitive step of thinking it was there, looking for it, seeing it gone, realizing I closed its last window and hunting it down in the (still appalling) Start Menu is distracting.
I consider it to be another example of my long held belief that Microsoft never, ever chosen the right alternative in any esthetic decision in its UI.
It's just a different paradigm. It's not like quitting the app is in any way difficult (it's just cmd+Q which I actually find a bit too easy to trigger by accident sometimes), it's just Macs don't consider an app to be the sum of its windows.
Conflating closing a document window with closing the app seems like a strange constraint.
This is completely unintuitive, unless you are a long term mac user. Neither windows nor any of the hundreds of linux window managers work so unexpectedly.
Particularly because of the inconsistency -- Control Panel (now System Settings) has always quit when you closed its window, but most other apps don't. (While QuickTime maddeningly acts both ways, depending on what you've done in the app.) I can't tell you how many times I ask myself why the heck Activity Monitor is running in the dock, only to realized that I closed the window rather than quitting it.
Having a GUI application, in a windows-based environment, run without any windows is just weird unless it's a background utility or something. Conceptually I've just never been able to get used to it.
I'm very happy that a lot of applications have moved to a single "master" window with documents living in tabs (e.g. Sublime, Photoshop, etc.), than the strange "menubar with no windows" app state. (Made even stranger by further inconsistent behavior where, for example, if you close all TextEdit or Terminal windows, it's in menubar-only mode, and then switch to a different app it's running in the background, but then if you tap the running TextEdit or Terminal in the dock it mysteriously makes a new window. Huh?)
Conversely it works well with apps that reload documents when they restart. You just close the app without closing the document. When you restart the app, the document is loaded and state is preserved.
This is not about a desire to keep apps running in the background, though there was some advantage to that in the old days when starting an app did take considerable time. Leaving it running in the background for some shortish time made some sense.
Non-document apps (like control panel) generally close when the window closes because there is no document to open and close. They usually only have a single window, anyway, or at least not multiple independent windows.
I think that part of the appeal of an app like this is about keeping things "tidy". MacOS seems to be built around making it easy to clutter -- lots of randomly sized overlapping windows (resolved using Rectangle for Aero-snap like functionality -- the weird full-screen split-screen nonsense in MacOS is just frustratingly limited and slow and has too many animations and transitions to be useful), dozens of apps filling up the dock, six hundred icons in the menu bar (which I use vanilla.app to resolve), and so on.
I think my mental model distinguishes between applications and utilities. Utilities are effectively like the old TSR tools -- you start them, then they just run quietly in the background until you need them, with no interface. Applications, by contrast, _are_ their interface, so it feels strange that when I close that interface, the application itself isn't closed. This utility alters the behaviour of the OS so that it conforms to this mental model. I suspect that this is a situation where there's no "right" approach, but rather a set of preferences and learned behaviours.
Just like cleaning up the recently used app list on the phone all the time, quitting all applications like this is a step backwards.
Phones have a different pedigree -- I'm not upset if an app that's "open" is unloaded after some time or due to system pressure, even if I lose state on my phone, possibly because that's how things have always been (for a given value of "always"), and possibly also because phones don't have a dock or task bar to track "running" apps. On a computer, if the app windows being closed means the app is (mostly) unloaded and I will need to restore state with a new window, why not close it entirely? What does having it sitting in the dock with a dot consuming (admittedly few) resources give me beyond just pinning a shortcut?
Your arguments are mostly ‘I’m used to Windows doing X so that’s what I want on the Mac.’ If you want Windows, use Windows, that’s a lot easier than trying to get Mac OS to be Windows. It’s not Windows, if you can get used to what it is you’ll have a great time and if not you’ll end up frustrating yourself.
Honestly, if you look in activity monitor there are over a hundred apps running without any windows being rendered.
Maybe it’s because I’ve always had more ram than I need?
I guess windows users?
Just because you can stand on your right leg doesn’t mean your left leg is useless. Learning to work with keyboard shortcuts together with your point-and-click skills will make you more efficient.
Of course you can close the app manually, but that is cumbersome: You close every window with command-W or a click, but have to remember to close the very last window with command-Q. If you select the app icon to quit, it will not just activate the app, but open a new Window. So the best way is to right click the dock icon and close. But then you have to think if there is still an window open or not, so you don't accidentially close it.
It's not a big deal, but it is a slight annoyance, just like how you can't close minimized windows. Apple actually implemented auto quitting apps in the Lion era, but removed it (probably because it was to Windowsy?).
macOS applications can still choose to close the app automatically when the last windows closes:
https://developer.apple.com/documentation/appkit/nsapplicati...
(macOS can't discern between apps I shut off manually before a restart and apps the OS shut off for the restart, so it ends up opening everything anyway.)
Disclaimer: Mac is my main platform since around 2010, before that Windows, and before that Amiga - one would think that more than a decade would be enough to acclimate, but the whole application model on Mac still feels weird :)
To create a new document window if you need it.
It looks like this app just sends a request to terminate (AppKit.NSRunningApplication.terminate()) to any app with no open windows (after a delay). If the app is already ready to terminate (termination counter is 0), most of the terminate work has likely already been done, and the app will probably just get killed. If the app isn't ready to terminate, invoking terminate is going to cause it to wake up and do whatever its own processes for terminating might be. For something lumbering and bloated like an Adobe app, this is going to be a ton of stuff. For modern macOS apps with good support for sudden termination/automatic termination, this is probably little or nothing at all.
So for apps that work well on macOS, this accomplishes little more than removing the icon from the dock and the app switcher. For apps that don't work well on macOS, this might or might not help things work any better.
With other operating systems, maybe quitting unused apps is worthwhile for performance or battery life or whatever. And some applications on the Mac, like (unfortunately) Excel, don't cooperate as well as they could with OS resource management, so quitting them when you're not using them is probably good. Otherwise, a modern macOS app that goes idle is going to be compressed and paged out and suspended so that it's not really soaking up any resources if it's not doing anything (even if it has windows and documents open, incidentally).
So, sure, quit apps with no open windows if you just want a tidy dock and app switcher. Unless I'm missing something, I think that might be all you're really getting.
So on the German Mac layout you are holding the Command key and pressing Q, closing the Application. The right input would be Option-L.
Great example: Apple's bizarre and petty refusal to put a real Delete key on its laptop or non-full-sized keyboards. They only have a Backspace key, mislabeled "delete." This means that millions of users are arrowing (or moving the insertion point by hand) across the characters they want to delete and backspacing them away. Apple apologists will howl, NOOOO! Command-delete! As if any normal user (especially switching from another platform) would guess this. And yes, they would have to guess this, because it's not marked on the keyboard.
This became doubly inexcusable with the deprecation of the Eject key. It's not as if Apple could pretend that there was "no room" for a Delete key... not that they could anyway, since everyone else manages to provide one.
I don't think there's a wrong or a right way here, there's just what you're used to. To be perfectly honest, I'm not sure if I completely understand your complaint - I almost exclusively use Windows and I'm not really sure what the Delete key does but is just 'reverse backspace'? I never use it.
The Delete key deletes the character to the right of the insertion point; the Backspace key deletes the character to the left. You must be wasting a lot of keystrokes!
A Delete key also deletes stuff; like E-mails, files... any currently-selected item in most applications. I don't "backspace" E-mails or other objects to delete them.
Again, I don't think either is more inherently correct, there's just what you're used to.
If you do a lot of editing, and certainly programming, you quickly chafe at the lack of a Delete key. I've been using Karabiner on the Mac to remap F12 to be Delete, losing the Volume-up control in the process. Annoying, but worth it.
The exception to that equivalence is in text editing where it behaves like backspace. But macOS doesn't ignore the desire to delete text in the other direction. fn+delete will perform a forward character delete.
Looking at a Macbook keyboard, regardless of what label Apple puts on it, you can see that it's missing either a Backspace key or a Delete key.
Interesting that even Apple chose the D key for "delete" and the action is "forward-delete" and not Backspace, though.
Cmd-Delete deletes text to the beginning of the input line, Fn-Delete is forward delete. Also, what’s with the inflammatory language?
“Apple proponents love to smugly point …”
“Apple apologists will howl, NOOOO! Command-delete!”
Closed apps running in background are like services. I do not need the window to be rendered in the background for messages or chat apps. I open them only when needed. Or having a large-ish apps I use on daily basis preloaded in compressed memory. It's just a sensible workflow.
There was a time where Apple was trying to make iOS/iPad the future of (Apple) computing, but it could just never happen partly because while Apple may have lowered the floor on ease-of-use, they also significantly lowered the ceiling of functionality compared to macOS (or Windows). Completely eliminated the long-tail of possibility that people use Real Computers for.
iPads now have the same CPU as some Mac computers, yet they're still significantly held back by software limitations (and have been pretty much since day one).
Listening to John Siracusa talk about creating such utilities and it's a story of ever decreasing API features making tasks like interrogating and controlling the OS or other apps increasingly hard especially if you want to be blessed by inclusion in the platform app store. It's super risky to invest your time/money creating an app like this because the chance it is broken in the next OS update is so high.
I fully agree that it's what makes computers special and I am very frustrated by "security" being the reason I can't make the computer behave as I wish. So many 3rd party fixes or innovative ideas (e.g. industry changing game mods) wouldn't have happened without malware like tactics of patching dlls which I believe every OS vendor would like to make forever impossible.
Safe computing is essential but not at the cost of killing the golden goose of general purpose computing with full user control. I wish the focus was more on transparency and control of what software is doing on a system and not cutting it's legs off.
1. Never validated by Apple
2. Requires disabling Gatekeeper
3. Permitted to run silently in the background
4. Permitted to control any other application
How would you check that even building it could run something you don't want on your computer? And if running it exposes a trojan?
After all, it's the only app from user "onebadidea" on github.
Please be good consumers...
Also there are few really annoying bugs that makes the app almost unusable: https://github.com/onebadidea/swiftquit/issues/1
I have a few dozen apps set to quit after specific periods of time. This allows me to run/resume certain apps for a few hours (VLC, Figma), while others shut down only 10 minutes after I use them (Messages, Calculator).
It's not a lot given what you get for the money (easy app publishing on the App Store, call support with Apple engineers etc.).
But SwiftQuit's dev doesn't make money with the app so he didn't see the need to pay that money just to sign the app. An unsigned app downloaded from the dev's website is as good as a signed one.
i used to think macos was was simpler than windows, but this type of 'feature' was just one of many that made me think, 'no - it was just marketing'.
If you have an app that with windows for things like documents, images, etc. When you finish one document and want to open a different document or create a new one, why should closing your first window also close the app. Do you then need to reopen the app to open the next document?
In Windows the window is the app. In Mac OS, the apps have windows. It’s just a different way of looking at things.