Sync Change Dir with Tabs?

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
igarny
Junior Member
Junior Member
Posts: 58
Joined: 2023-01-26, 19:01 UTC

Sync Change Dir with Tabs?

Post by *igarny »

Based on request: viewtopic.php?t=4779

I often browse parallel directory structures, so cm_SyncChangeDir is one of my favourite features of tcmd.

Sometimes in the middle of browsing, I want to look up something in another directory, so I open a new tab in one panel. In my ideal universe, the synched browsing would "pause" while the new tab is open, and then resume when I return to the oribinal tab. But unfortunately cm_SyncChangeDir isn't tab-aware.

So if I want to temporarily pause a synchronized browsing session, I have to do the following:
open a new tab
toggle off cm_SyncDirChange
...do whatever in the new tab...
close the new tab
navigate to the original tab
make sure the directories are correct
toggle on cm_SyncDirChange
What I would like is for tcmd to remember which directories are currently set to synchronize changed dirs.

I know the idea of two-panel tabs was discussed and dismissed back when tabs were still under development, but here's a thought: Linked tabs!

FEATURE REQUEST:
>>Locked LINKED PAIR TABS <<
Linked tabs would have the following features:
  • Once activated "the linked tabs", the two tabs from source and destination panel become a locked pair
  • if one wants to switch folders, that can't be matched on the destination panel, it should be rejected. One should move to another tab OR unlock
  • have the state locked pair recognized by the View AutoSwitchMode (low priority)
  • when you switch to a tab from linked locked pair in the source panel, tcmd has a command to find and switch the corresponding tab from the pair in the destination panel. This would prevent us the confusion of switching between tabs and eventually passing through a locked pair, which may lead to an unintended switch of the tab on the destination panel, if automatic switching was to be implemented.
  • cm_SyncChangeDir is a setting local to these two linked tabs
What I like about this idea is that it really fits in well with the OFM model, where you often deal with pairs of directories rather than single directories.

FEATURE REQUEST / BUG report
>> Synced History traversal <<
cm_SyncChangeDir does not recognize (or at least could have an attempt for) traversal of folders from other triggers/sources/commands:
  • History traversal
  • Direct input on the tab location input field
FEATURE REQUEST:
>>cm_SyncDirChange to be Tab Aware <<
  • when you switch to one of the linked tabs, in either window TCMD automatically switches to the corresponding (Linked) tab in the other panel
  • cm_SyncChangeDir is a setting local to these two linked tabs. Currently is an attempt for a global switch

Apologies for the long rambly post. Thanks, and please carry on.


Michael & Ivan
Last edited by igarny on 2023-01-27, 09:52 UTC, edited 2 times in total.
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Sync Change Dir with Tabs?

Post by *petermad »

Support++ for cm_SyncChangeDir to be tab-aware.

As for the Linked tabs feature - that should already be doable using View Modes with Auto Switch Mode and the APPENDTABS command.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
igarny
Junior Member
Junior Member
Posts: 58
Joined: 2023-01-26, 19:01 UTC

Re: Sync Change Dir with Tabs?

Post by *igarny »

Thanks @petermad for the comment I have updated the initial request

With regards the Auto Switch Mode(ASM) suggestion, I see no option to define a specific view mode for:
  • both tabs simultaneously
  • define a rule for the ASM based on the "cm_SyncChangeDir" state. But on top the the feature request speaks about: "cm_SyncChangeDir" state for the linked pair tabs
igarny
Junior Member
Junior Member
Posts: 58
Joined: 2023-01-26, 19:01 UTC

Re: Sync Change Dir with Tabs?

Post by *igarny »

I have updated and clarified the Initial request
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Sync Change Dir with Tabs?

Post by *petermad »

2igarny
With regards the Auto Switch Mode(ASM) suggestion, I see no option to define a specific view mode for:

both tabs simultaneously
define a rule for the ASM based on the "cm_SyncChangeDir" state. But on top the the feature request speaks about: "cm_SyncChangeDir" state for the linked pair tabs

Try this as an example:
Put this in your usercmd.ini file (it is located the same place as your current wincmd.ini file - if it does not exist, just make it)

Code: Select all

[em_gotodir2]
cmd=cd
path=c:\test2\

[em_opentaboppositedir]
cmd=cm_FocusTrg,cm_GoToParent,cm_OpenDirInNewTab,cm_CloseDuplicateTabs,cm_FocusTrg,cm_SyncChangeDir
Put this in your wincmd.ini file:

Code: Select all

[ViewModes]
0_name=<standard>
0_icon=
0_options=-1|-1|0||-1|-1|-1|-1|-1
1_name=SyncTabs1
1_icon=%COMMANDER_EXE%,6
1_commands=em_gotodir2,em_opentaboppositedir|cm_SyncChangeDir
1_options=-1|-1|0||16744576|16768477|-1|-1|-1
2_name=SyncTabs2
2_icon=%COMMANDER_EXE%,6
2_options=-1|-1|0||16744576|16768477|-1|-1|-1

[ViewModeSwitch]
Enabled=1
0_rules=+c:\test1\*\
0_mode=1
1_rules=+c:\test2\*\
1_mode=2
If you already have the [ViewModes] and [ViewModeSwitch] sections, then rename them while you are testing.

Make the c:\test1 and c:\test2 directories and add som common subdirs to both.

Now try to enter the c:\test1 directory - it should open c:\test2 in a tab in the opposite panel, and color both panels light blue and enable the SyncChangeDir function.

Do NOT try and add a similar [em_gotodir1] command to usercmd.ini and a 2_commands=em_gotodir1,em_opentaboppositedir|cm_SyncChangeDir to the [ViewModes] section to try to make it also work when you enter c:\test2 - it will cause an indefinite loop in TC
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply