Command + W shortcut

Hello,
I didn’t find post about this, in most mac os apps when you use command + w it minimize the app (red cross event), could you implement it in obsidian or is there another shortcut to do it ?

Current workaround

Click with the mouse on the red cross.

Thanks for nice app and have a nice day.

You might be a bit confused about macOS behavior.

  • cmd+M should minimize the window in all your macOS apps, Obsidian included.

  • cmd+W these days generally means: close the tab or pane, not the entire window. To emulate that behavior, you should assign cmd+W to the Obsidian command “Close active pane” in your settings.

  • In all macOS apps, the red cross button closes the window even if it contains multiple tabs or pane. This behavior is usually mapped to shift+cmd+W (try it in Chrome for example). To emulate that behavior, you should go to macOS System Preferences > Keyboard > Shortcuts > App Shortcuts and assign shift+cmd+W to the menu item “Close Window”. This is really only useful if you have multiple vaults and juggle between them.

3 Likes

Thanks for the very detailed reply ! :pray:

cmd+W closes tabs and if there is only one tab left it closes the app, same as shift+cmd+w (try it in chrome for example) but either way when I use shift+cmd+W in obsidian it didn’t do anything.
I searched for a shortcut to close obsidian app in the same way and didn’t found. That’s why I am making this feature request !

Sorry for bad explanation when I talked about red cross I meant a shortcut to close the app without shutting it down nor minimising it.

Hello, does this feature was seen ?

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.

If you want to close all panes, but keep your vault open, consider using the command, Close all other panes which will close all but one.

But it sounds like what you really want is to close your vault. @obsequious gave a good suggestion if you want to map Shift-Cmd-W. Google how to add app-specific hotkeys.

  • Go to keyboard shortcuts
  • Go to “App shortcuts”
  • Click the + sign to add a new one
  • Choose Obsidian, and type exactly “Close Window”, or if you are using a different language/locale, then you will need to type it exactly as the command is seen in your menu.
    Screen Shot 2022-08-07 at 9.06.28 PM

Unless I am not understanding, all the functionality is already there, so I am going to move this from “Feature Requests” to “Help”.

This is what I have in my macOS system preferences:

screenshot.2022-08-08T041741Z

1 Like

I just saw that some apps didn’t close, like Anki or figma.

But most apps with tabs (or not) do close and most of electron based apps are doing it (the shortcut file → close tab is closing the window), that’s why I was asking if it could be made as a feature.
Just test it yourself, press cmd+W in most of electron app it will close the window.

I tried to manually add the shortcut but it isn’t working, I don’t know maybe I am missing something ?

@rigmarole I am asking to have the same behaviour when using cmd+w in obsidian like in most of other electron apps or browsers.

Thanks everyone for taking time to answer :raised_hands:

You have to type it exactly as it appears in your menu. It is case sensitive.

Not “Close window”, it is “Close Window”

1 Like

Thanks @rigmarole ! This workaround is working !

Have a nice day everyone.

1 Like