2

Sorry if this has been asked before or has an obvious solution, I couldn't find either a reason or solution online when searching for this.

⌘ Command W closes tabs on Safari. The problem is, I don't know which tab it switches focus to after closing a tab. Sometimes it focuses tabs left, sometimes right. Usually when it is doing this, it consistently switches focus either left or right, but then at times it will seemingly change near the end. I really have no idea why this is happening, and it is extremely annoying when trying to close multiple tabs and keep others open, as I can't predict whether it's going to close the tab I want or not when using the shortcut many times quickly.

Please if you know the reason / pattern / way I can fix it or alternative solution to closing tabs (even third party is fine, as long as it works consistently), I would appreciate it greatly.

0

1 Answer 1

1

If anyone stumbles across this thread wondering the same thing, I will write the behaviour below.

basic behaviour

Tab closes switch focus right, until rightmost tab is reached, then switch focus left.

full behaviour

  • Tabs are grouped together based on ‘parent tabs’.
  • Every tab created with CmdT (equivalently, clicking the plus icon) is a parent tab. Upon opening a new link from a tab, that becomes a child tab. Child tabs can have child tabs etc.
  • When you close a tab with CmdW, it will then try and close all sibling tabs, based on basic behaviour (making sure not to close tabs on a higher level than it).
  • Once this is done it will then move to its parent tab, and then close all tabs on that level. This repeats until you are at the highest level (level of the new tab), and basic behaviour occurs again.

There doesn't seem to be a way to "flatten" the implicit tab hierarchy or influnce the "close tab" behaviour in general.

1
  • 1
    If you got the time, you can enable Safari's internal debug menu (defaults write com.apple.Safari IncludeInternalDebugMenu 1), then enable "tab ordering" -> "show tab ancestry in tab title" and just experiment.
    – hym3242
    Commented May 16 at 23:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .