-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cmd+W
with no open tabs doesn't close the window
#5322
Comments
Yes, it’s one of those little things that would make Zed better for me. I frequently work with just single files at a time. Having that last window automatically close would be awesome. |
This is expected MacOS behaviour and sorely needed! |
Fixes #5322 Release Notes: - Changed cmd+w with no open tabs to close window [#5322](#5322) https://github.com/zed-industries/zed/assets/22855292/113b1635-ae30-4718-a3d3-758a4bf53714
TBH I think the way VSCode designed this feature is a mistake. There are two separate actions:
and it happens that we want to use the same keybinding for these actions. The proper way to implement it is mapping the same key in different contexts, not introducing an "option". Also, there is not an application on macOS that I know behaves this way. They never have an "empty" state as it always requires a file/document to work with. But in Zed, we have an empty state and it is useful. Following macOS behavior is just wrong. My apologies if it sounds harsh. Zed is moving fast and ships lots of useful features but it also introduces breaking changes that make it frustrating to use. Especially with someone who didn't come from VS Code world like me. |
I agree with @dangh . On Linux and Windows, VSCode doesn't close the window on Ctrl+W, but Zed now does apparently (assuming Ctrl+W is the Linux/Windows equivalent of Cmd+W). Yuck! I hate that! I'd like that this change be restricted to macOS only, or reverted :) |
We are reverting this change in #10986. A new Preview build will be out soon without this behavior. |
@maxdeviant any chance we can get this back for macOS? Not being able to close the window with cmd+w when no tabs are left is really the opposite of what you would expect from a Mac app. |
I agree. I’ve been running Mac for nearly 30 years and no native app leaves a window open. And even Electron apps adhere to that. Give us an option. |
@fuzenco I hope the option would be mapping the key in different contexts like I described above. In fact, that's how Safari does it too. When the window has tab, Cmd+W is bind to Close Tab, but on an empty window it's bind to Close Window. All the macOS apps I know either work with single documents (so there's no point leaving an empty window) or have an option to restore the closed window (all browsers have that). Zed is not in the first category so if we want to make that the default behavior then restorable must be shipped together. |
Many apps don't have the concept of an open project where you would want to keep a window open with no tabs. But for a text editor, people frequently keep a project/folder open with no tabs. That is why I consider this macOS design to be awful UX. In a browser, you can just close the window when you close the tab. Not so for text editors. Context matters in UX-design. |
I don’t know about that. One of the longest-running text editors on Mac—over 30 years—the famed BBEdit, allows for closing a project window when there is no tab open. |
Sure, and my opinion is that that is terrible design. Almost every editor I know doesn't do this on Windows/Linux, including VSCode and Sublime Text. There's a reason for that. The special exceptions being text editors, like Notepad on Windows, that don't open folders/projects, which I think demonstrates my point well: Closing all tabs does not mean you want to close the whole project/folder. |
And that’s why we are asking for the option, even if that’s not the default you would wish. |
Also, you can close a window without this option. You use the specific keybinding that closes the window: Ctrl+Shift+W. I'm certainly not opposed to people having an option of a keybinding overload, I just don't think it should be on by default on any platform (who knows, I might want to or have to use macOS in the future!) Anyways, one option is to allow Ctrl+W to close the window only if there is no project/folder opened and there are no tabs open. If there is a project/folder opened, then it shouldn't ever close the window. That'd already be a vast improvement for a small change in design. The biggest reason why I think Ctrl+W should not close the window when there's a project open is because if I were to press Ctrl+W too many times for the tabs I have open, then I would accidentally close the window when I didn't intend for that. |
I was so excited to see this was finally done and then saw it was reverted! I understand that it perhaps doesn't feel right in Windows or Linux. But on Mac, it is expected behaviour to have So, we need an |
So... this issue is in the closed state now. But it's not actually closed. Can we re-open please? @mikayla-maki can help reopen maybe? |
It still doesn't work for me (macOS Sonoma 14.4.1, Zed 0.133.5) |
It's not working for me either (macOS Sonoma 14.4.1, Zed 0.133.5). |
We reverted the change, so that’s why it isn’t working. |
whyy whyy whyy |
…#11989) Follow up to: #10986 However, I have set this to have a default behavior of 'auto': matching the current platform's conventions, rather than a default value of 'off'. fixes #5322. Release Notes: - Changed the behavior of `workspace::CloseActiveItem`: when you're using macOS and there are no open tabs, it now closes the window ([#5322](#5322)). This can be controlled with a new setting, `when_closing_with_no_tabs`, to disable it on macOS, or enable it on other platforms.
It's on main now, should be hitting stable in two weeks and change :) |
…zed-industries#11989) Follow up to: zed-industries#10986 However, I have set this to have a default behavior of 'auto': matching the current platform's conventions, rather than a default value of 'off'. fixes zed-industries#5322. Release Notes: - Changed the behavior of `workspace::CloseActiveItem`: when you're using macOS and there are no open tabs, it now closes the window ([zed-industries#5322](zed-industries#5322)). This can be controlled with a new setting, `when_closing_with_no_tabs`, to disable it on macOS, or enable it on other platforms.
Is your feature request related to a problem? Please describe.
Just a tiny nit (feel free to say if these tiny bugs aren't helpful), but when the window is empty, I would have expected
Cmd+W
to act likeCmd+Shift+W
, but it currently does nothing.(See: behaviour in Atom, VS Code)
The text was updated successfully, but these errors were encountered: