Obsidian Should Close the Window When The Last Tab is Closed

Use case or problem

Currently Obsidian does not close the window when the last tab is closed. This is inconsistent with most macOS applications.

Proposed solution

Obsidian should either the window when the last tab is closed.

Current workaround (optional)

Currently, a user needs two separate keyboard shortcuts. CMD W to close the tab. And CMD SHIFT W to close the window.

This is inconsistent with most macOS applications where one should only need to hit CMD W a few times and then the entire window should close.

Related feature requests (optional)

This is a related feature request: Close obsidian window with cmd w on mac. Leave app running for faster launch

However, I believe that feature request is focusing on the keyboard shortcut whereas the real issue seems to be that unlike other macOS apps (Chrome, Sublime Text, Finder) closing the last tab does not close the window. Visual Studio Code takes a similar approach where closing the last tab doesn’t close the window immediately, but pressing CMD-W after the last tab is closed will indeed close the window.

1 Like

I don’t care what happens on a mac, but I NEVER want to see this implemented on Obsidian in Windows or Linux.

It is a perfectly normal thing to close the current set of tabs you’re working on in order to start afresh on a new project or area of interest (which means opening other tabs immediately after all the existing ones have been closed).

It would be extremely annoying to have the entire application window close just because you clicked (or pressed a hotkey) one time too many. The user would end up having to always remember to close all tabs except one, then open the new set of desired tabs, before going back to the last unwanted tab to close it.

It also doesn’t make any sense from a UI perspective. A tab close button is to close a tab. The window has its own close button for closing the entire window. That’s literally what it’s there for.

6 Likes

Agreed on every point, and especially this. My god that would be frustrating if closing all tabs closed Obsidian!! :dizzy_face:

3 Likes

I think alternatively if we could follow the same pattern as Visual Studio Code or Arc Browser where closing the last tab actually closes the last tab and leaves an empty shell of a window.

Then on pressing CMD W a second time, it actually closes the window.

2 Likes

Please see this video of how it currently works in VS Code:

Note that this is just closing the window not closing the application.

1 Like

It’s funny with all the threads talking about slow startup times that there are people looking for ways to more easily close the app. I went so far as to remove my close button via CSS so I never accidentally exit :stuck_out_tongue_winking_eye:

@AlJohri you could easily achieve what you want with CustomJS or any of the JavaScript plugins. Set Cmd+W to point to a script and have that script send a close tab command, unless there are no open tabs, in which case send the close app command.

This behaviour depends totally on the app. And I agree with Quisquose, it’s a totally sensible thing to close all tabs through the process of working, and then open more. To close the app, you can use Cmd-Q like every other app, or to close the vault, consider remapping “Close Window” to a hotkey in MacOS:

I thought this FR existed, but it was just a help thread. Here is some previous discussion.

Great idea! I’ll give this a shot when I get a chance. If anyone else already has done something like this please do share.

1 Like

In macOS there is a difference between closing the window vs closing the application. I would like to close all of the windows but leave the application open and in focus.

That completely depends on the app. Some apps remain open without any windows. Some automatically close. Which behaviour are you asking for? If you want to close the entire app, use Cmd-Q, like every other app in MacOS.

I would like the app to remain open without any windows and use CMD W to close all of the open tabs and then the active window.

3 Likes

Ran into the same problem and created a quick fix. Don’t have the time to create a proper plugin for this, but it seems to fix it for now!

I’d say is less of a way to “close the app” (this doesn’t actually close the app) and more of a way to make the application’s behavior consistent with what the user is expecting. This is pretty much the standard behavior for macOS, and it’s not intuitive when a single application in your stack behaves differently.

I think the expected would be that the “last tab” was indeed a tab, and if it was closed you’d get no tabs, and close again it would close the windows (exactly like VSCode).