[TC 11.03] Trying to open custom app for diff yields an error

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Karmalakas
Junior Member
Junior Member
Posts: 4
Joined: 2024-12-07, 14:07 UTC

[TC 11.03] Trying to open custom app for diff yields an error

Post by *Karmalakas »

TC v11.03 64 bit (2024-02-21)

I've added to wincmd.ini:

Code: Select all

Editor=C:\Users\Karmalakas\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe "%1"
CompareTool=C:\Users\Karmalakas\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe diff "%1" "%2"
Editor works just fine, but the diff gives me:
File not found!
"C:\Users\Karmalakas\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe diff"
I believe TC adds the "diff" part to a file path and naturally there's no such file.

Tried having just:

Code: Select all

CompareTool=C:\Users\Karmalakas\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe diff
But same error
Runnning this from the Win+R (Run) window and it works as expected

I also tried changing quotes to isolate just:

Code: Select all

CompareTool="C:\Users\Karmalakas\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe" diff "%1" "%2"
But the in PhpStorm I get:
Command 'diff'
Usage: phpstorm diff []
So it seems TC isn't passing file paths if initiated this way
User avatar
Dalai
Power Member
Power Member
Posts: 9943
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC 11.03] Trying to open custom app for diff yields an error

Post by *Dalai »

Add one set of quotes around the whole command to make it work properly, e.g.

Code: Select all

Editor="C:\Users\Karmalakas\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe "%1""
Not sure if CompareTool can contain parameters though. If it doesn't you can use a small wrapper script as CompareTool. Maybe something like this:
phpstorm_diff.cmd:

Code: Select all

@echo off
setlocal
set "diff=%UserProfile%\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe"
call "%diff%" diff %*
endlocal
Parameters will automatically be passed through as is.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6950
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [TC 11.03] Trying to open custom app for diff yields an error

Post by *Horst.Epp »

Making a button for the tool, using the parameters %C1 %C2 should work.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
Karmalakas
Junior Member
Junior Member
Posts: 4
Joined: 2024-12-07, 14:07 UTC

Re: [TC 11.03] Trying to open custom app for diff yields an error

Post by *Karmalakas »

Dalai wrote: 2024-12-07, 14:40 UTC If it doesn't you can use a small wrapper script as CompareTool
This kinda worked, but it opens a CMD window in the background and keeps it until I close the diff tool :(

Horst.Epp wrote: 2024-12-07, 15:02 UTC Making a button for the tool, using the parameters %C1 %C2 should work.
A button isn't an option, because I'd like to open diff tool also from Sync Dir window to check specific files
User avatar
Dalai
Power Member
Power Member
Posts: 9943
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC 11.03] Trying to open custom app for diff yields an error

Post by *Dalai »

Karmalakas wrote: 2024-12-07, 17:57 UTCThis kinda worked, but it opens a CMD window in the background and keeps it until I close the diff tool :(
Replace

Code: Select all

call "%diff%" diff %*
with this

Code: Select all

start "" "%diff%" diff %*
The window will still flash though.

[EDIT]
Added the missing diff parameter.
[/EDIT]
Last edited by Dalai on 2024-12-07, 23:23 UTC, edited 1 time in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Karmalakas
Junior Member
Junior Member
Posts: 4
Joined: 2024-12-07, 14:07 UTC

Re: [TC 11.03] Trying to open custom app for diff yields an error

Post by *Karmalakas »

Dalai wrote: 2024-12-07, 18:32 UTC with this

Code: Select all

start "" "%diff%" %*
The window will still flash though.
This just opens two separate tabs of the selected two files, but not a diff fieature :/

Oh, it's missing another `diff`:

Code: Select all

start "" "%diff%" diff %*
This works, although CMD window still flashes

Thanks for this workaround 8) But I still consider this as a bug and it should work directly. Hope this will be fixed at some point
User avatar
Dalai
Power Member
Power Member
Posts: 9943
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC 11.03] Trying to open custom app for diff yields an error

Post by *Dalai »

Karmalakas wrote: 2024-12-07, 23:05 UTCOh, it's missing another `diff`:
Yes, sorry about that. Edited my post above accordingly. There's too many "diffs" in the code :lol:.
This works, although CMD window still flashes
Yes, just as I said. There's no way around it, with this approach anyway.
But I still consider this as a bug and it should work directly. Hope this will be fixed at some point
It can be considered a bug, but only if CompareTool is supposed to support parameters. I don't know if it does. I've never used CompareTool and the help on it is rather ... um ... let's just say, the explanation could be much more detailed than it is right now.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
white
Power Member
Power Member
Posts: 5744
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.03] Trying to open custom app for diff yields an error

Post by *white »

Karmalakas wrote: 2024-12-07, 14:17 UTC Tried having just:

Code: Select all

CompareTool=C:\Users\Karmalakas\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe diff
TC seems to add quotes when the CompareTool setting contains a space and no quotes are used. So TC is trying to run:
"C:\Users\Karmalakas\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe diff" (including the quotes)

So you need to add quotes yourself, so use:

Code: Select all

CompareTool="C:\Users\Karmalakas\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe" diff
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.03] Trying to open custom app for diff yields an error

Post by *ghisler(Author) »

Not a Total Commander bug.

Moderator message from: ghisler(Author) » 2024-12-08, 10:09 UTC

Moved to English forum.
Author of Total Commander
https://www.ghisler.com
User avatar
Karmalakas
Junior Member
Junior Member
Posts: 4
Joined: 2024-12-07, 14:07 UTC

Re: [TC 11.03] Trying to open custom app for diff yields an error

Post by *Karmalakas »

white wrote: 2024-12-08, 00:17 UTC So you need to add quotes yourself, so use:

Code: Select all

CompareTool="C:\Users\Karmalakas\AppData\Local\Programs\PhpStorm\bin\phpstorm64.exe" diff
This worked perfectly :shock:
So I see I only needed to remove the params

Code: Select all

"%1" "%2"
Does that mean that TC passes them automatically? Well... I suppose so :D

Thanks! No need for intermediate script
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.03] Trying to open custom app for diff yields an error

Post by *ghisler(Author) »

Does that mean that TC passes them automatically?
Yes, TC assumes that "CompareTool" contains just the program name which accepts two files as parameters. If the name contains spaces, TC surrounds it with double quotes. To include your own parameters, you must put the program itself in double quotes yourself, and the parameters too if they contain spaces.
Author of Total Commander
https://www.ghisler.com
Post Reply