You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MacVim closes when bringing up the "About MacVim" window when there are no other windows open #1257
Also I just realized if I press any menu bar item, e.g "MacVim", "File", "Edit", etc., and then press the menu bar item again, the application will close.
Just out of curiosity though why would you have those two options? It seems somewhat contradictory and I’m curious why someone would configure MacVim that way.
I've tested with the latest MacVim 9.0.65 (173) on Catalina.
I set the options below and reload MacVim
Open untitled window === "never"
After last window closes === "Quit MacVim"
I opened MacVim and opened preferences window, closed it without changes and MacVim exited which agree with my understanding of "Quit after last window closes"
I opened MacVim and opened about window, closed it without changes and MacVim exited which agree with my understanding of "Quit after last window closes"
I opened settings and new editor window. Closing one of windows doesn't quit the app, which agree with my understanding of "Quit after last window closes"
Could you please explain me, where is the contradiction?
@ychin it 100% is contradictory to have the settings configured the way I did. I've already changed those options to something sane, but I couldn't help but investigate what was happening when the About screen disappeared immediately when I opened it up.
I have a unique use case since I'm using MacVim as a proxy to have a reliably updated vim executable since my company blocked homebrew on our machines. For the most part I'm using vim in a terminal and have aliased it to point to MacVim's instance of vim. I really only open the GUI when I need to open a large file to search around in faster than TextEdit, or when I feel like it has been a while since I've updated MacVim and more importantly updated the vim version.
I've tested with the latest MacVim 9.0.65 (173) on Catalina.
I set the options below and reload MacVim
Open untitled window === "never"
After last window closes === "Quit MacVim"
I opened MacVim and opened preferences window, closed it without changes and MacVim exited which agree with my understanding of "Quit after last window closes"
I opened MacVim and opened about window, closed it without changes and MacVim exited which agree with my understanding of "Quit after last window closes"
I opened settings and new editor window. Closing one of windows doesn't quit the app, which agree with my understanding of "Quit after last window closes"
Could you please explain me, where is the contradiction?
@eirnym for me, step 3 has a different behavior. When I choose the option to open the About MacVim window, if it will be the only window owned by MacVim, it flashes on screen very quickly, then automatically closes itself, and then MacVim exits.
I observe the flash, but it's not doing every time I close MacVim and I can't consistently say, that this is any kind of a ghost window or not.
Additionally, I observe similar flashing when closing Terminal.app, Preview.app and few others I've just tested when I close the app which has no open windows left. This flash is not quite visible when there's no opened browser with 100 tabs spread to few windows opened. I believe the opening and the closing animations are played independently if there're any opened windows or not.
Could you try to disable or minimize closing macOS animations by using ui tweaks or changing defaults?
This setting is done by using the applicationShouldTerminateAfterLastWindowClosed API. It's kind of up to macOS when it calls it and when it feels like closing the application, so maybe it depends on different conditions.
I think I will just make it clear that the options of "Open untitled window === never" and "After last window closes === Quit MacVim" cannot be set together. Maybe add some preference pane logic to make it so as well, and/or enforcing this mutual exclusion in the code. It just doesn't make sense to have them set together, as by definition macOS should immediately close the app. In fact I wonder if in a future version of macOS, having those options set together would cause MacVim to keep closing itself causing the user to never be able to change the setting in the preference pane which would be bad, so this should be fixed (the user can obviously still use the terminal to set it using defaults, but that's not ideal).
Activity
jwanja commentedon Jul 28, 2022
Also I just realized if I press any menu bar item, e.g "MacVim", "File", "Edit", etc., and then press the menu bar item again, the application will close.
ychin commentedon Jul 29, 2022
Oh that’s interesting. Does seem like a bug.
Just out of curiosity though why would you have those two options? It seems somewhat contradictory and I’m curious why someone would configure MacVim that way.
eirnym commentedon Jul 29, 2022
I've tested with the latest MacVim 9.0.65 (173) on Catalina.
Could you please explain me, where is the contradiction?
jwanja commentedon Jul 29, 2022
@ychin it 100% is contradictory to have the settings configured the way I did. I've already changed those options to something sane, but I couldn't help but investigate what was happening when the About screen disappeared immediately when I opened it up.
I have a unique use case since I'm using MacVim as a proxy to have a reliably updated vim executable since my company blocked homebrew on our machines. For the most part I'm using vim in a terminal and have aliased it to point to MacVim's instance of vim. I really only open the GUI when I need to open a large file to search around in faster than TextEdit, or when I feel like it has been a while since I've updated MacVim and more importantly updated the vim version.
jwanja commentedon Jul 29, 2022
@eirnym for me, step 3 has a different behavior. When I choose the option to open the About MacVim window, if it will be the only window owned by MacVim, it flashes on screen very quickly, then automatically closes itself, and then MacVim exits.
eirnym commentedon Jul 29, 2022
I observe the flash, but it's not doing every time I close MacVim and I can't consistently say, that this is any kind of a ghost window or not.
Additionally, I observe similar flashing when closing
Terminal.app,Preview.appand few others I've just tested when I close the app which has no open windows left. This flash is not quite visible when there's no opened browser with 100 tabs spread to few windows opened. I believe the opening and the closing animations are played independently if there're any opened windows or not.Could you try to disable or minimize closing macOS animations by using ui tweaks or changing defaults?
ychin commentedon Aug 4, 2022
This setting is done by using the
applicationShouldTerminateAfterLastWindowClosedAPI. It's kind of up to macOS when it calls it and when it feels like closing the application, so maybe it depends on different conditions.I think I will just make it clear that the options of "Open untitled window === never" and "After last window closes === Quit MacVim" cannot be set together. Maybe add some preference pane logic to make it so as well, and/or enforcing this mutual exclusion in the code. It just doesn't make sense to have them set together, as by definition macOS should immediately close the app. In fact I wonder if in a future version of macOS, having those options set together would cause MacVim to keep closing itself causing the user to never be able to change the setting in the preference pane which would be bad, so this should be fixed (the user can obviously still use the terminal to set it using
defaults, but that's not ideal).Fix bad interaction with never opening window + terminate on last window
MacVim Release 174