This script adds a TabDedupe command to close duplicate tabs, but with a default option to protect (not close) the current tab so you could just add it to your open new tab/close current tab shortcuts/buttons and not have to manually invoke any dedupe commands, but also not worry that the newly opened tab will be deduplicatedly closed¹
It can also operate on both lister panes
Supported arguments:
right close dupes from ← right to left (default)
left close dupes from → left to right
noprotect close current tab if it's a dupe
dual close dupes in both left/up and right/down panes (uses the same left/right argument for each)
¹ you could also add a dedupe command before opening a new tab
TabDedupe dual
Go CURRENT NEWTAB
but this might have a strange side effect of opening a tab at the end of the tabbar instead of near the active tab when you tried to open a 3rd dupe tab
Thanks for a great script !
Everything seems to be working for Tabdedupe Right and Tabdedupe Left.
But, I think Tab Dedupe Dual still has a small problem.
That said, I am not getting consistent results no matter what tab position is active on either pane or what pane has focus. I thought I could identify what it really is by changing the position of the active tabs.
Unfortunately, I have yet to be able to understand this action by simple trial and error despite many attempts to do so.
This script is a nice entry to a Tabs Context Menu.
Multiple identical tabs easily happen, at least for me.
Tab Dedupe Dual is the same as Tab Dedupe Right Dual, all Dual does is runs the same closeDuplicateTabs function on the inactive tabset and with a different destination tab to protect
Hopefully you can get there! Though maybe you could check the script function logic and spot a mistake there?