Issue when launching PsPad editor with relative program path

English support forum

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
X-Byte
Member
Member
Posts: 172
Joined: 2004-11-29, 09:34 UTC
Location: Hessen, Germany

Issue when launching PsPad editor with relative program path

Post by *X-Byte »

I've been trying to make sense of some behavior which has been bugging me for a long time now and spent a few hours examining it.

I'm using Total Commander in a portable setup, which means I make heavy use of relative path addressing within Total Commander with %COMMANDER_PATH% being the starting point to include plugins, inis, viewers and the custom editor, which in my case is PsPad. It all works like a charm, EXCEPT when it comes to launching files for editing in PsPad with F4.

While the first file opens fine in a newly launched PsPad, all following files which I want to edit with F4 open in the already launched PsPad with PsPad.exe for binary editing in a tab and in an additional tab the file which I actually want to edit.

I've experimented with quotes around the editor program and for the filename parameter in multiple ways.
I've tried different paths for TC and PsPad, still maintaining the relative path for the editor call.

It seems to me as soon as there's a relative path portion, like "." (current directory) or ".." (parent directory) within the editor program path, this odd PsPad behavior occurs. But it only occurs with PsPad, it doesn't happen with Notepad++ which I also tried during my research efforts.

To make things worse, this behavior is not persistent even with the same configuration. Switching back and forth between different editor path addressing methods in TC, it sometimes works without a problem with ".."s in the path.

Maybe at least one or some of you can confirm this in their own environment. Or maybe I'm the only one... or I'm nuts.

Here's what I tried:
Fresh portable installation of Total Commander 9.51 (64+32) in C:\test\TC
Freshly unpacked PsPad 5.0.3 in C:\test\PsPad

- Launch TC 64bit
- Configure Editor to: C:\test\PsPad\PsPad.exe "%1"
- Press F4 on a text file
- PsPad starts and opens the text file
- Back in TC, press F4 again on another text file
- PsPad opens the other text file in a new tab
-> All fine

Now let's try that with just a tiny bit of relative path addressing for the editor. make sure you close TC and PsPad before you start over.
- Launch TC 64bit
- Configure Editor to: C:\test\TC\..\PsPad\PsPad.exe "%1"
- Press F4 on a text file
- PsPad starts and opens the text file
- Back in TC, press F4 again on another text file
- PsPad opens its own binary PsPad.exe in a new tab and in addition the other text file in another tab
-> NOT fine

User avatar
Dalai
Power Member
Power Member
Posts: 7049
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Issue when launching PsPad editor with relative program path

Post by *Dalai »

I tried it, and I can confirm it. It's a PsPad issue. Open a CMD and run these commands:

Code: Select all

C:\test\PsPad\PsPad.exe C:\some\file.txt
C:\test\PsPad\Colors\..\PsPad.exe c:\some\other\file.txt
The same issue will occur. PsPad's command line parsing routine seems to get confused by such paths, at least when the single instance option is enabled (I wasn't able to disable it, so I couldn't test it with multiple instances).

My guess is that it compares its own path (C:\test\PsPad\PsPad.exe) to the path of the newly launched instance (C:\test\PsPad\Colors\..\PsPad.exe) - which obviously fails in such a case. But that's just a shot in the dark, and up to the developer to find out and solve ;).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups

User avatar
nsp
Power Member
Power Member
Posts: 1265
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Issue when launching PsPad editor with relative program path

Post by *nsp »

I've made a test with pspad 32bit 5.04 (385) using a button TC 9.51 32/64 bit

Code: Select all

command: %COMMANDER_PATH%\..\pspad\PSpad.exe
parameter:%P%S
First time you launch pspad all is OK, next time you launch pspad you have this weird behaviour.
It is also the same from a cmd console.

Code: Select all

:From pspad folder
..\pspad\pspad.exe PSPad.url
..\pspad\pspad.exe Licence.txt
This is a Pspad issue !
You can report bug in pspad forum.

User avatar
Horst.Epp
Power Member
Power Member
Posts: 3708
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Issue when launching PsPad editor with relative program path

Post by *Horst.Epp »

Why don't you use the %COMMANDER_DRIVE% as start ?
No need for any .. contructs
Windows 10 Home x64 May 2020 Update, Version 2004 (OS Build 19041.264)
Intel(R) Core(TM) i7-4770 CPU @ 3.40GH, 16GB RAM
TC 9.51 x64 / x86, Everything 1.4.1.983 (x64)

Post Reply