Just from the video I am guessing that there is an internal lastTab
variable somewhere. When you CMD+T the first time lastTab
is on the first leftmost tab. When you do it again it gets overwritten to the previous blank tab you just opened. So when you close it the browser goes back to lastTab
and if you close it again lastTab
points to the tab being closed so the browser falls back to tab on the right, and if there is none then the tab on the left. It's probably more complicated than that but I'm not familiar with the Chromium source code.
To be honest I'd probably be 80% satisfied with an option to always put new blank tabs opened with CMD+T (not CMD+clicked) to the right of the current tab or "related tab group." FWIW Safari has this as an option in the debug (not develop) menu that you have to enable in the command line, but it doesn't work consistently and I gave up trying to understand its tab behavior.