comparePlus icon indicating copy to clipboard operation
comparePlus copied to clipboard

When Notepad++ is opened cli doesn't work properly

Open zBugi opened this issue 8 months ago • 1 comments

I tried executing the command notepad++ -pluginMessage=compare C:\a.json C:\b.json from cmd. It worked properly as long as notepad++ wasn't opened already, by opening notepad++ with the 2 files in the compare view. But when I tried using the same command after I already opened notepad++ it doesn't open the two files for comparison. It just opens them like normal files without adressing the compare funktion.

zBugi avatar Apr 16 '25 08:04 zBugi

I will check this but it is most likely due to Notepad++ not sending the initialization message triggering the compare command to the ComparePlus plugin. It is kind-of expected because Notepad++ is already opened and just maximizes its window the second time you use the command line - it processes command line only when it is starting for the first time. You can try enabling Notepad++ multi-instance mode from its Settings - this way your second command line call will open completely new Notepad++ instance that will process the initialization again and will trigger the compare command. I am not sure about it but AFAIR there was another Notepad++ command line parameter - something like -multiInst or -multiInstance - you could try adding it to the command line triggering the files comparison.

pnedev avatar Apr 16 '25 12:04 pnedev

@zBugi ,

As I suspected you'll need to use the -multiInst command line Notepad++ option in your case to open the files in another Notepad++ instance that will receive the compare command line trigger - the existing Notepad++ instance does not get it.

BR

pnedev avatar Oct 18 '25 21:10 pnedev