Auto-switch and view mode
Moderators: Hacker, petermad, Stefan2, white
Auto-switch and view mode
I believe I have searched thoroughly for an answer to my questions but found nothing.
My question is:
Let's say I have two folders, Downloads and Downloads/capture each of which are configured to 'auto-switch' to a specific view and _also_ to revert to a default view (in this case cm_SrcLong) when leaving the folder.
I find that I can go to, say, Downloads and the view changes correctly. However when I leave this folder by navigating into the Downloads/capture folder, the view change to Full (in accordance with the auto-run cmd |cm_SrcLong) but doesn't switch to the view mode specified by the auto-switch config for this Downloads/capture folder.
Is this expected behaviour? Does an auto-run command for _leaving_ an auto-switch folder take precedence over a view mode for a folder that happens to be a folder to which I navigate from another auto-switch folder with a _leave_ auto-run command.
This is quite difficult to explain. I hope my question is clear. Thanks for any help. I love TC.
My question is:
Let's say I have two folders, Downloads and Downloads/capture each of which are configured to 'auto-switch' to a specific view and _also_ to revert to a default view (in this case cm_SrcLong) when leaving the folder.
I find that I can go to, say, Downloads and the view changes correctly. However when I leave this folder by navigating into the Downloads/capture folder, the view change to Full (in accordance with the auto-run cmd |cm_SrcLong) but doesn't switch to the view mode specified by the auto-switch config for this Downloads/capture folder.
Is this expected behaviour? Does an auto-run command for _leaving_ an auto-switch folder take precedence over a view mode for a folder that happens to be a folder to which I navigate from another auto-switch folder with a _leave_ auto-run command.
This is quite difficult to explain. I hope my question is clear. Thanks for any help. I love TC.
Re: Auto-switch and view mode
This works fine for me:
If you have other viewmodeswitches defined, they might be the problem, if they come before your switches for Downloads and Downloads/Capture - try moving the switches to the top of the list. You can move the selected iem with the little up- and down arrows to the right of the Roles list.
This also works:
but will of course work on all Capture folder not just Capture folders as subfolders to Downloads.
Code: Select all
[ViewModes]
0_name=<default>
0_icon=
0_options=-1|-1|0||-1|-1|-1|-1|-1
1_name=test
1_icon=
1_commands=|cm_SrcLong
1_options=0|-1|0||-1|-1|-1|-1|-1
[ViewModeSwitch]
Enabled=1
0_rules=+*\Downloads\
0_mode=1
1_rules=+*\Downloads\Capture\
1_mode=1
This also works:
Code: Select all
[ViewModes]
0_name=<default>
0_icon=
0_options=-1|-1|0||-1|-1|-1|-1|-1
1_name=test
1_icon=
1_commands=|cm_SrcLong
1_options=0|-1|0||-1|-1|-1|-1|-1
[ViewModeSwitch]
Enabled=1
0_rules=+*\Downloads\
0_mode=1
1_rules=+*\Capture\
1_mode=1
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Auto-switch and view mode
If your Downloads auto-switch mode is above the Downloads/capture auto-switch mode and includes subdirectories, then TC will keep using the Downloads auto-switch mode.
Please post your [ViewModeSwitch] and [ViewModes] sections from the wincmd.ini so I can analyze them.
Please post your [ViewModeSwitch] and [ViewModes] sections from the wincmd.ini so I can analyze them.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Auto-switch and view mode
Thanks for the quick reply.
Here's a screengrab of me going to Downloads folder and then to Capture folder (and back and forth etc).
https://youtu.be/u5cGRaiv70I
Expected and desired behaviour:
Going to Downloads folder switches view mode. Leaving Downloads folder switches to Full view except when the 'new' folder has its own 'Auto-Switch' config, in which case its view mode is applied.
What happens? (As shown in video)
I go to Downloads and view mode correctly applied. I enter Capture folder, with it's own Auto-Switch config, but it is not applied. Full view mode is applied.
Here's wincmd.ini settings:
I'm sorry there's a lot of other *bumf* in wincmd.ini. I was going to troubleshoot this by removing all extraneous settings but couldn't be arsed. 
Here's a screengrab of me going to Downloads folder and then to Capture folder (and back and forth etc).
https://youtu.be/u5cGRaiv70I
Expected and desired behaviour:
Going to Downloads folder switches view mode. Leaving Downloads folder switches to Full view except when the 'new' folder has its own 'Auto-Switch' config, in which case its view mode is applied.
What happens? (As shown in video)
I go to Downloads and view mode correctly applied. I enter Capture folder, with it's own Auto-Switch config, but it is not applied. Full view mode is applied.
Here's wincmd.ini settings:
Code: Select all
[ViewModes]
0_name=<default>
0_icon=
0_options=-1|-1|0||-1|-1|-1|-1|-1
1_name=Order by date
1_icon=
1_options=-1|3|1||-1|-1|-1|-1|-1
2_name=Comments
2_icon=
2_commands=cm_100percent 60|cm_50percent, cm_SrcLong
2_options=4|-1|0||-1|-1|-1|-1|-1
3_name=Full view
3_icon=
3_options=1|-1|0||-1|-1|-1|-1|-1
4_name=Order date + ext
4_icon=
4_options=1|3|1||-1|-1|-1|-1|-1
5_name=Capture
5_icon=
5_commands=|cm_SrcLong
5_options=12|101|1||-1|-1|-1|-1|-1
6_name=Comments + date
6_icon=
6_commands=|cm_SrcLong
6_options=11|3|1||-1|-1|-1|-1|-1
7_name=Downloads
7_icon=
7_commands=|cm_SrcLong
7_options=12|1|1|-102|-1|-1|-1|-1|-1
8_name=Images / video
8_icon=
8_commands=|cm_SrcLong
8_options=9|-1|0||-1|-1|-1|-1|-1
9_name=Size+Date+mediaInfo
9_icon=
9_commands=|cm_SrcLong
9_options=12|-1|0||-1|-1|-1|-1|-1
Code: Select all
[ViewModeSwitch]
Enabled=1
0_rules=+c:\Users\tom\Downloads\capture\*\
0_mode=5
1_rules=+c:\Users\tom\Downloads\00_TODO\
1_mode=6
2_rules=+c:\Users\tom\Downloads\tmp\dev-current\
2_mode=1
3_rules=+c:\Users\tom\Downloads\
3_mode=7
4_rules=+c:\Users\tom\Documents\bin\apps\
4_mode=2
5_rules=+c:\Users\tom\Documents\bin\
5_mode=3
6_rules=+c:\Users\tom\Documents\docs\jotClip\journal\
6_mode=4
7_rules=+c:\Users\tom\Documents\media\visual\personal\archive\*\
7_mode=8
8_rules=+c:\Users\tom\vimfiles\bundle\
8_mode=2
9_rules=+c:\Users\tom\Documents\bin\apps\pandoc_templates\
9_mode=2
10_rules=+*\plugins\*\
10_mode=2
11_rules=+c:\Users\tom\Documents\media\audio\*\
11_mode=9
12_rules=+c:\Users\tom\Documents\media\visual\other\*\
12_mode=9

Re: Auto-switch and view mode
I pruned the other ViewMode and ViewModeSwitch settings but I still have the same problem.
If I navigate to the Capture folder bypassing the Downloads folder, everything works as expected.
However, if I navigate to the Capture folder through the Downloads folder, the ViewMode is not applied.
The same is true if I go to the Downloads folder through the Capture folder.
Here is a better organised screen capture:
https://youtube.com/shorts/gHErAnaYjtA?feature=share
If I navigate to the Capture folder bypassing the Downloads folder, everything works as expected.
However, if I navigate to the Capture folder through the Downloads folder, the ViewMode is not applied.
The same is true if I go to the Downloads folder through the Capture folder.
Here is a better organised screen capture:
https://youtube.com/shorts/gHErAnaYjtA?feature=share
Code: Select all
[ViewModes]
0_name=<default>
0_icon=
0_options=-1|-1|0||-1|-1|-1|-1|-1
1_name=Capture
1_icon=
1_commands=|cm_SrcLong
1_options=12|101|1||-1|-1|-1|-1|-1
2_name=Downloads
2_icon=
2_commands=|cm_SrcLong
2_options=12|1|1|-102|-1|-1|-1|-1|-1
Code: Select all
[ViewModeSwitch]
Enabled=1
0_rules=+c:\Users\tom\Downloads\capture\*\
0_mode=1
1_rules=+c:\Users\tom\Downloads\
1_mode=2
Re: Auto-switch and view mode
Is Downloads a real directory on a partition or a virtual folder? It's been many time explained that some file management functions might not work as expected in virtual folders.
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
Re: Auto-switch and view mode
2takahaya
It is not quite clear what you want to accomplish.
Which changes would you like to apply when entering Downloads - View, Sorting, others
Which changes would you like to apply when entering Downloads - View, Sorting, others
What state would you like to end up with when not in either of the two dirs - View, Sorting, others.
Right now whith the setting you show here above I can only see that you set the sortting to Ext. descendimg when you enter Downloads - and then you have an additional sortorder of -102 which refers to a custom column. For Capture you have set the Columns view and the Sort order to blank which is actually not valid.
It is not quite clear what you want to accomplish.
Which changes would you like to apply when entering Downloads - View, Sorting, others
Which changes would you like to apply when entering Downloads - View, Sorting, others
What state would you like to end up with when not in either of the two dirs - View, Sorting, others.
Right now whith the setting you show here above I can only see that you set the sortting to Ext. descendimg when you enter Downloads - and then you have an additional sortorder of -102 which refers to a custom column. For Capture you have set the Columns view and the Sort order to blank which is actually not valid.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Auto-switch and view mode
@Usher
@petermad
Image: https://photos.app.goo.gl/fDcvKKbsZBPrCpGo6
---
Downloads folder is set to mode Downloads.
Image: https://photos.app.goo.gl/oNAMCpemXE4tMdLf7
---
Capture mode is set to custom columns view with sorting on a custom column (write date):
Image: https://photos.app.goo.gl/hCZnJsmUWBSw4oZ98
---
Downloads mode is set to same custom column and sorted on extension and a custom column (write date):
Image: https://photos.app.goo.gl/magxDFSyT5v3oeEg8
---
Both Capture and Downloads mode is set to custom Columns view '7 Size + Date + mediainfo'. This custom column uses content plugins including tc, shelldetails, and tcmediainfo.
Image: https://photos.app.goo.gl/Vjb6LAZixejuqnZS9
They're both simple/real folders on system drive / one partition.Is Downloads a real directory on a partition or a virtual folder?
@petermad
capture folder is set to mode Capture.It is not quite clear what you want to accomplish [...]
Image: https://photos.app.goo.gl/fDcvKKbsZBPrCpGo6
---
Downloads folder is set to mode Downloads.
Image: https://photos.app.goo.gl/oNAMCpemXE4tMdLf7
---
Capture mode is set to custom columns view with sorting on a custom column (write date):
Image: https://photos.app.goo.gl/hCZnJsmUWBSw4oZ98
---
Downloads mode is set to same custom column and sorted on extension and a custom column (write date):
Image: https://photos.app.goo.gl/magxDFSyT5v3oeEg8
---
Both Capture and Downloads mode is set to custom Columns view '7 Size + Date + mediainfo'. This custom column uses content plugins including tc, shelldetails, and tcmediainfo.
Image: https://photos.app.goo.gl/Vjb6LAZixejuqnZS9
Re: Auto-switch and view mode
2takahaya
The froblem is that you use |cm_SrcLong in both View modes.
The solution is to remove the |cm_SrcLong from the Capture and Downloads:
https://madsenworld.dk/tcmd/viewmodes1.png
https://madsenworld.dk/tcmd/viewmodes2.png
And then make a view mode for entering folders that resets the view to Full - like:
https://madsenworld.dk/tcmd/viewmodes3.png
Thet view switch has to be one of the last in the list:
https://madsenworld.dk/tcmd/viewmodes4.png
Or you could just make the <default> mode set Full view:
https://madsenworld.dk/tcmd/viewmodes5.png
But that can have side effects.
The froblem is that you use |cm_SrcLong in both View modes.
The solution is to remove the |cm_SrcLong from the Capture and Downloads:
https://madsenworld.dk/tcmd/viewmodes1.png
https://madsenworld.dk/tcmd/viewmodes2.png
And then make a view mode for entering folders that resets the view to Full - like:
https://madsenworld.dk/tcmd/viewmodes3.png
Thet view switch has to be one of the last in the list:
https://madsenworld.dk/tcmd/viewmodes4.png
Or you could just make the <default> mode set Full view:
https://madsenworld.dk/tcmd/viewmodes5.png
But that can have side effects.
Last edited by petermad on 2022-08-28, 10:53 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Auto-switch and view mode
@petermad
However, does this mean we cannot set any Auto-run commands for leaving a folder (e.g. "|cm_SrcLong") because this would interfere with other View Mode settings for other rules?
Also, there is a peculiarity in Auto Switch Mode I don't understand.
I have created, as recommended, an Auto Switch Mode for "L: With Drive Letter > 123456". The View Mode for this sets Column View to "Full" and Sort Order to "Name".
As you said, when leaving my Downloads and Downloads/capture folders, this rule is applied successfully. However, for some reason it is not applied when changing from a folder not defined in Auto Switch rules. One would expect this rule to be applied to ALL folders when no other rule applies.
As it happens, this peculiarity is good because otherwise petermad's recommendation wouldn't really work - any folder change would invoke this rule overriding any custom column or sort order settings.
Perhaps I've failed to understand how Auto Switch works?
My original question:
@takahaya
Is it "expected behaviour"? Maybe someone should mention this exception in the help docs and maybe here too for other users?
Thanks again for supporting great software.
Ok, so your recommendation works in my case.The solution is remove the |cm_SrcLong from the Capture and Downloads:
However, does this mean we cannot set any Auto-run commands for leaving a folder (e.g. "|cm_SrcLong") because this would interfere with other View Mode settings for other rules?
Also, there is a peculiarity in Auto Switch Mode I don't understand.
I have created, as recommended, an Auto Switch Mode for "L: With Drive Letter > 123456". The View Mode for this sets Column View to "Full" and Sort Order to "Name".
As you said, when leaving my Downloads and Downloads/capture folders, this rule is applied successfully. However, for some reason it is not applied when changing from a folder not defined in Auto Switch rules. One would expect this rule to be applied to ALL folders when no other rule applies.
As it happens, this peculiarity is good because otherwise petermad's recommendation wouldn't really work - any folder change would invoke this rule overriding any custom column or sort order settings.
Perhaps I've failed to understand how Auto Switch works?
My original question:
@takahaya
It would appear the answer is "yes, auto-switch commands when leaving a folder (eg my |cm_SrcLong) will override auto-switch view mode settings for another folder when leaving the former folder to this latter folder".Is this expected behaviour? Does an auto-run command for _leaving_ an auto-switch folder take precedence over a view mode for a folder that happens to be a folder to which I navigate from another auto-switch folder with a _leave_ auto-run command.
Is it "expected behaviour"? Maybe someone should mention this exception in the help docs and maybe here too for other users?
Thanks again for supporting great software.
Re: Auto-switch and view mode
Then try and make the L rule so that you don't set the Sort order to Full, set it to Unchanged, and then apply an Autorun command *cm_StcFull instead.As you said, when leaving my Downloads and Downloads/capture folders, this rule is applied successfully. However, for some reason it is not applied when changing from a folder not defined in Auto Switch rules. One would expect this rule to be applied to ALL folders when no other rule applies.
This is a very good question - and it seems to be the case - although I think is shouldn't be.Is this expected behaviour? Does an auto-run command for _leaving_ an auto-switch folder take precedence over a view mode for a folder that happens to be a folder to which I navigate from another auto-switch folder with a _leave_ auto-run command.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Auto-switch and view mode
My answer is "yes".takahaya wrote: 2022-08-26, 01:46 UTC Is this expected behaviour?
Does an auto-run command for _leaving_ an auto-switch folder take precedence over a view mode for a folder
that happens to be a folder to which I navigate from another auto-switch folder with a _leave_ auto-run command.
It would appear the answer is "yes, auto-switch commands when leaving a folder (eg my |cm_SrcLong)
will override auto-switch view mode settings for another folder when leaving the former folder to this latter folder".
Is it "expected behaviour"? Maybe someone should mention this exception in the help docs and maybe here too for other users?
I think it is explained here analogous: 1. VIEW MODE -> |cm_SrcViewMode0 - 2 of 3: ...
I tried to solve your first example (at the top):Quote from Mr. Ghisler (Email 7.6.2018): wrote: This is due to the fact that with a directory change
- first it will be switched to the new View Mode,
- then the procedure behind | is executed in the old mode,
- and finally that before | in the new mode.
Therefore cm_SrcViewMode0 removes the just set new mode. Unfortunately this cannot be solved otherwise.
SOLUTION: Do NOT use the command cm_SrcViewMode0 after the '|', because the Auto Switch Mode
ends itself anyway. EXAMPLE: viewtopic.php?p=414703#p414703
- View Mode <default>
Columns view: Full
Sort order: Name
Whenever a View Mode with Auto Switch Mode is FINISHED, then TC AUTOMATICALLY switches to that <default>-view.
If you don't enter anything here, the sorting will remain until it is replaced by another View Mode. - |cm_SrcLong must be REMOVED from the 'Auto-run commands'-field *)
TC_clean_x64.ini - Section "ViewModes" and "ViewModeSwitch" --- user = your user name on the PC
Code: Select all
[ViewModes]
0_name=<default>
0_icon=
0_options=1|0|0||-1|-1|-1|-1|-1
1_name=Capture
1_icon=
1_options=6|100|1||-1|-1|-1|-1|-1
2_name=Downloads
2_icon=
2_options=6|1|1|-101|-1|-1|-1|-1|-1
[ViewModeSwitch]
Enabled=1
0_rules=+c:\Users\user\Downloads\capture\*\
0_mode=1
1_rules=+C:\Users\user\Downloads\
1_mode=2
However, there are many other use cases where the commands that follow the "|" are quite welcome, e.g.
cm_100percent|cm_50percent
cm_VerticalPanels|cm_VerticalPanels
cm_VerticalPanels,cm_100Percent|cm_VerticalPanels,cm_50Percent
etc.
Re: Auto-switch and view mode
Thanks everyone for all your help.
After further experimentation I find that the combined behaviour of Auto Switch Mode / View Mode and the Auto-run commands of View Mode is so random it would take pages of caveats to fully explain all of them.
I suggest people experiment, use what works for them, and don't sweat apparent anomalies. If things don't work as you would expect, just smile and carry on.

After further experimentation I find that the combined behaviour of Auto Switch Mode / View Mode and the Auto-run commands of View Mode is so random it would take pages of caveats to fully explain all of them.
I suggest people experiment, use what works for them, and don't sweat apparent anomalies. If things don't work as you would expect, just smile and carry on.

Re: Auto-switch and view mode
2takahaya
The View Mode and Auto Switch Mode is NOT based on the random principle but on precisely defined rules.
If you had read my summary (which you yourself quoted in the forum) more carefully (e.g. 1. VIEW MODE -> View Mode <Default>),
then your request should not have been necessary.
After your statements, I am now not at all sure whether you were able to solve your posted problem,
because you haven't said a word about it.
If someone needs support, e.g. on this topic then there are certainly many forum members who can provide it.
Overview: View Mode | Auto Switch Mode | Custom columns view

The View Mode and Auto Switch Mode is NOT based on the random principle but on precisely defined rules.
If you had read my summary (which you yourself quoted in the forum) more carefully (e.g. 1. VIEW MODE -> View Mode <Default>),
then your request should not have been necessary.
After your statements, I am now not at all sure whether you were able to solve your posted problem,
because you haven't said a word about it.
If someone needs support, e.g. on this topic then there are certainly many forum members who can provide it.

Overview: View Mode | Auto Switch Mode | Custom columns view
Re: Auto-switch and view mode
Sorry, random was not the right word.
Thanks to all your help I no longer have a problem with Auto Switch View Modes.
Can I make a suggestion? The following info is important and should be made prominent in help docs:
<viewtopic.php?t=53559> by tsuka.
However, it contains a lot of a extraneous detail about internal commands etc unnecessary to understand ASVM for the average user. Personally I felt the need to read and understand everything in the post thinking if I didn't I would miss something important.
May I suggest the above post be supplemented / preceded by a succinct precis of ASVM usage including the information noted above?
Otherwise, again, thanks again for a fantastic piece of software.
Thanks to all your help I no longer have a problem with Auto Switch View Modes.
Can I make a suggestion? The following info is important and should be made prominent in help docs:
Re-worded for clarity:View Mode, Order of processing:
- first it will be switched to the new View Mode,
- then the procedure behind | is executed in the old mode,
- and finally that before | in the new mode.
Also this:- new View Mode based on Auto Switch rules applied
- If directly switching from one Auto Switch rule to another, Auto-run command after | of the previous View Mode is applied
- Finally, Auto-run command before the | of the current View Mode is applied
Also: the most comprehensive outline of Auto Switch View Modes (ASVM) in one place seems to beWhenever a View Mode with Auto Switch Mode is FINISHED, then TC AUTOMATICALLY switches to that <default>-view.
<viewtopic.php?t=53559> by tsuka.
However, it contains a lot of a extraneous detail about internal commands etc unnecessary to understand ASVM for the average user. Personally I felt the need to read and understand everything in the post thinking if I didn't I would miss something important.
May I suggest the above post be supplemented / preceded by a succinct precis of ASVM usage including the information noted above?
Otherwise, again, thanks again for a fantastic piece of software.