Skip to content
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

How to make Safari not to close window when close last tab #11

Open
shhider opened this issue Jan 2, 2023 · 0 comments
Open

How to make Safari not to close window when close last tab #11

shhider opened this issue Jan 2, 2023 · 0 comments
Labels

Comments

@shhider
Copy link
Owner

shhider commented Jan 2, 2023

Safari browser will close the whole window when you press Cmd+W to close the last tab. But I hope Safari can keep the window and open Start Page automatically. There is no option to change it in Safari preference.

Safari 浏览器只剩最后一个 Tab 时、再 Cmd+W 就会关闭整个窗口,而我习惯了即使关闭最后一个 Tab 也保留窗口、替换为一个开始页。浏览器的偏好设置内没有相关设置项。

Solution: Overwrite "Cmd+W" shortcut to always execute "Close Tab" in "System Preference - Keyboard - Shortcuts - App Shortcuts - Safari".

解决办法:在系统偏好设置-键盘-快捷键中,设置 Safari 的「Close Tab」为 Cmd+W。

Why: Looking at the "Cmd+W" in menu, it depends on the number of tabs. If there are multiple tabs, it's "Close Tab"; It there is one tab, it changes to "Close Window". So, overwriting this shortcut can disable this change.

原因:存在多个 Tab 时,Safari 的 Cmd+W 是指向「Close Tab」;而只有一个 Tab 时,Safari 的 Cmd+W 会自动指向「Close Window」。通过系统中覆盖这个快捷键,就能使 Cmd+W 始终指向「Close Tab」。

image

@shhider shhider added the macOS label Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant