Ignore "CompareTool=" if TC is called with /S=C

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
HolgerK
Power Member
Power Member
Posts: 5411
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Ignore "CompareTool=" if TC is called with /S=C

Post by *HolgerK »

The reason behind this is to run the compare as a separate process.

Add the following line to the wincmd.ini [Configuration]-section.
CompareTool=%COMMANDER_EXE% /S=C
Start a compare between two files:

Code: Select all

---------------------------
Total Commander
---------------------------
File not found!



"C:\Tools\totalcmd\TOTALCMD64.EXE /S=C"
---------------------------
OK   
---------------------------
also explicitly quoted
CompareTool="%COMMANDER_EXE%" /S=C
failed.
This time with an endless loop TC calling TC calling TC calling TC...
Only way to stop this was command line with:

Code: Select all

taskkill /F /IM totalcmd.exe
It seems that the one possible way is to use
CompareTool="%COMMANDER_EXE%" /I=null /S=C
but all settings for the compare tool are default in this case.

Is it possible to ignore the "CompareTool=" wincmd.ini setting if TC is called with parameter "/S=C"?
I guess everyone using "/S=C" as parameter would like to use TC and not windiff or any other comparer defined as CompareTool inside TC.

Regards
Holger
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Wow, recursion is funny. :D
I found another way to stop it: I edited CompareTool key and saved wincmd.ini. :)
User avatar
white
Power Member
Power Member
Posts: 5986
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Confirmed using TC8.01 32bit.
I added to wincmd.ini: CompareTool="%COMMANDER_EXE%" /S=C

Tested OK using TC8.50b12 32bit. Except when files are equal. If the files are equal, I get a message saying the two files have the same contents. After I click OK in that message window, I get an AV error.
---------------------------
Application Error
---------------------------
Exception EAccessViolation in module TOTALCMD.EXE at 0000B934.
Access violation at address 0040CB74. Write of address 00000010.
---------------------------
OK
---------------------------
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50865
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, this isn't supported. also %COMMANDER_EXE% isn't even defined outside of TC.
Author of Total Commander
https://www.ghisler.com
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7012
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

ghisler(Author) wrote:Sorry, this isn't supported. also %COMMANDER_EXE% isn't even defined outside of TC.
Thats not outside of TC !
They use it from inside of TC by defininig the Compare tool.
User avatar
white
Power Member
Power Member
Posts: 5986
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Tested OK using TC8.50b13 32bit.
User avatar
HolgerK
Power Member
Power Member
Posts: 5411
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

ghisler(Author) wrote:Sorry, this isn't supported.
Yes, that's why i placed this under TC-Suggestions.
also %COMMANDER_EXE% isn't even defined outside of TC.
Yes, but usable inside wincmd.ini.

I will play a little bit with the /I= parameter to get an acceptable working solution for me, but i still think an easy configurable separate process for TC's compare window called via "Files->Compare by content" is something that is worth to think about.
- The compare window in edit mode would not be forced to closed if the TC main instance terminates.
- Comparing of large files (x86) would not be influenced by the memory consumption of the main instance.

Regards
Holger
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Let me add one:
- If some plugin like Imagine does hard work in a foreground, separate compare window wont't hang.

I think there is no much sense in reading CompareTool option in case of /S=C parameter because it is much faster to call external compare tool directly instead of starting it via separate TC instance.

So I support request to ignore CompareTool option in case of /S=C parameter.
User avatar
white
Power Member
Power Member
Posts: 5986
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

2HolgerK
2MVV
I see no problem when using TC8.50b13 32bit. Have you tried this 32 bit version?
Last edited by white on 2013-12-19, 09:06 UTC, edited 1 time in total.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Yes, I'm using TC 8.50b13x32.
User avatar
HolgerK
Power Member
Power Member
Posts: 5411
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

white wrote:Have you tried this 32 bit version?
Yes.
Both versions ends up in a recursive call.
The only difference i see is that the x64 version took a while to terminate after creating the next instance (lot of totalcmd64.exe processes visible in taskmager).

Regards
Holger
Make our planet great again
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50865
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You could use a different ini file for the compare tool:

CompareTool=%COMMANDER_EXE% /i=c:\totalcmd\other.ini /S=C
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5986
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

white wrote:2HolgerK
2MVV
I see no problem when using TC8.50b13 32bit. Have you tried this 32 bit version?
OK, I can confirm it now. I started the beta with /I parameter. That's why I couldn't confirm the problem. The TC instance started with "%COMMANDER_EXE%" /S=C used my default ini file.

So, indeed one need to specify a different ini file. Alternatively a command line parameter could be implemented which overrides the setting in the ini file. For example similar to the /S=L:N (use internal lister), you could have /S=C:N (use internal compare tool).
User avatar
HolgerK
Power Member
Power Member
Posts: 5411
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

history.txt wrote:22.12.13 Fixed: Compare by content: Ignore ini setting "CompareTool" when calling TC via parameter /S=C, to avoid infinite loops when CompareTool points again to Total Commander (32/64)
This works fine now without any recursion and all previous set custom settings.
Tested with TC850B14 (x64&x32).

Many thanks!
Holger
User avatar
white
Power Member
Power Member
Posts: 5986
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Tested OK using TC850b14 32bit.
Post Reply