add focus_tab to restore tab focus by default - #9163
Conversation
|
The reason it was done that way was to preserve the history. If you want to preserve visual position instead then the activity history gets lost. I dont know if that's a worthwhile tradeoff, it should probably be an option for save_as_session. Or better would be to preserve both, possibly by some new syntax in the session file, say some JSON data for the new_tab command similar to how it is done for restoring window layout data. |
Thanks for the explanation, I have suspected it was done for a reason. By "history" do you mean the order the tabs are created? I don't think they (visual order & history) are inclusive of one the other, i.e. not possible to preserve both. I'm quite certain my workflow is different than your workflow at this point. So I'll explain mine:
IIUC, step 4 is what you didn't expect? I'm happy with just adding another option. Or just keep it as is, a custom kitty is also straightforward. Downside is relying on some internal API. I'm mostly fine with it. When I upgrade, I expect some part to be broken and most of the time, they're easy fixes. |
|
Just had a look at the |
|
Yes, it is for jumping back. |
We probably can't use the order of serialisation for both tab history and visual history. I see two options:
|
I think previously the code was trying to sort tabs by activity history (least recently used → most recently used). But this didn't preserve the order of the tabs as they appear. With the
focus_tabaddition, we don't need to do that any more. We just need to save them as they appear and addfocus_tabat the end to restore the focus