Skip to content

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

@shhider

Description

@shhider

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions