Focus last used pane or tab after closing current tab or pane (revised)

Use case or problem

The setting “always focus new tab” is enabled.

Imagine the following 3 tabs.
tab 1 ,tab 2, tab 3 (not yet opened)

The current behavior:

  1. Clicking file link in tab 1 → file opens in tab 3, focus changes to tab 3
  2. click x on tab 3 or run “close current tab” in tab 3 → tab 3 closes, focus changes to tab 2

Proposed solution

  1. Clicking file link in tab 1 → file opens in tab 3, focus changes to tab 3
  2. click x on tab 3 or run “close current tab” in tab 3 → tab 3 closes, focus changes to back to tab 1

Notes

The proposed close tab behavior would behave more like vscode.

I don’t seem to have the problem in internet browsers because browsers open a link in the tab immediately to the right of the current tab. However, while changing the place a tab opens may be an option, this feature request would be a better solution. It’s a better solution because of the following use case:

Additional Use Case

Imagine the following 3 tabs.
tab 1 (currently focused) ,tab 2, tab 3

Current Behavior

  1. Change focus to tab 3.
  2. Close tab 3 → focus changes to tab 2

Proposed Behavior

  1. Change focus to tab 3.
  2. Close tab 3 → focus changes to tab 1