[9.51] Create new file (with space in name and without extension) confirmation dialog

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
anton-09
Junior Member
Junior Member
Posts: 3
Joined: 2020-08-13, 16:59 UTC

[9.51] Create new file (with space in name and without extension) confirmation dialog

Post by *anton-09 »

I'm using Windows 10 (x64), TC 9.51 (x64), AkelPad 4.9.8 (x64) as TC editor.

When creating new file without extension and with space in the name (like "a a"), an editor is opened with such a dialog.
Image: https://i.ibb.co/CJNgzXc/TCAkelpad-Info-Dialog.png
Whatever I press, file is created.
Problem is not reproduced in following cases:
- add extension ("a a.txt")
- remove space ("aaa")
- use older version of TC (8.51 x64)

Since the problem occurs is newer version of TC and doesn't occur in older version with the same editor version, I assume the problem is in TC.
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: [9.51] Create new file (with space in name and without extension) confirmation dialog

Post by *Stefan2 »

Hi and welcome anton-09.

Try this with default Windows Notepad or with notepad2, no such problem (with default Shift+F4).

Might be just AkelPad ?

How had just set up / integrated AkelPad into TC and how do you create your file?
Maybe you have missed correct "%1" quoting?




 
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: [9.51] Create new file (with space in name and without extension) confirmation dialog

Post by *sqa_wizard »

Well, no such problem here (TC 9.51 32 and 64-bit on Win10) using SHIFT-F4 to create a new file without extension and with space in the name (like "a a") with Metapad-Editor.
#5767 Personal license
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [9.51] Create new file (with space in name and without extension) confirmation dialog

Post by *Dalai »

You should check the command line that your editor is launched with. You can do that with Process Explorer, Process Hacker (or even Process Monitor). No such problem here with ConTEXT or Notepad++, although I see that the file name gets dot at the end, i.e. "a a." but that's true for TC 8.52a and 9.51...

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

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: [9.51] Create new file (with space in name and without extension) confirmation dialog

Post by *gdpr deleted 6 »

Strangely, the AkelPad titlebar in your screenshot seems to display the correct file path "m:\a a", and the document tab there also shows the correct file name "a a". Something is up with AkelPad, me thinks...


A quick test (unless you are already playing around with ProcessMonitor/Hacker):

Open a cmd window (not using TC), and then try each of the following command line invocations independently:

Code: Select all

"C:\whatever_the_path_to_your_AkelPad.exe" "m:\a a"
(no space or dot after the last "a")

Code: Select all

"C:\whatever_the_path_to_your_AkelPad.exe" "m:\a a."
(a dot after the last "a")

Code: Select all

"C:\whatever_the_path_to_your_AkelPad.exe" "m:\a a "
(a space after the last "a")

Code: Select all

"C:\whatever_the_path_to_your_AkelPad.exe" "m:\a a ."
(a space and dot after the last "a")


Of course, use the actual path to the AkelPad.exe and not "whatever_the_path_to_your_AkelPad.exe" ;)

What is the result? Do you get the same error dialog in AkelPad when trying any these command line invocations?
anton-09
Junior Member
Junior Member
Posts: 3
Joined: 2020-08-13, 16:59 UTC

Re: [9.51] Create new file (with space in name and without extension) confirmation dialog

Post by *anton-09 »

I've checked command line in Process Explorer, look at screenshot
Image: https://i.ibb.co/Jt93dxk/Error.png

Old TC puts dot at the end of filename while new TC puts dot after filename.
This dot in new version leads to the opening of a second copy of AkelPad with error message

Configuration is same in both versions - %commander_path%\PLUGINS\EXE\AkelPad\Akelpad.exe
New file I create with SHIFT+F4

Looks like I should modify Editor run string, but why is there such a difference in the behaviour of the old and new TC?


UPD: changed Editor string for new TC to default "notepad.exe" and looked up command line in Process Explorer - dot after filename, but notepad (unlike AkelPad) somehow works correctly with it:

Code: Select all

C:\Windows\notepad.exe "m:\a a".
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [9.51] Create new file (with space in name and without extension) confirmation dialog

Post by *Dalai »

anton-09 wrote: 2020-08-13, 18:27 UTCI've checked command line in Process Explorer, look at screenshot
Image: https://i.ibb.co/Jt93dxk/Error.png
Confirmed. Somehow I missed that difference between TC versions, although I saw the trailing dot (as I mentioned above).
UPD: changed Editor string for new TC to default "notepad.exe" and looked up command line in Process Explorer - dot after filename, but notepad (unlike AkelPad) somehow works correctly with it
It seems that most of the editors can deal with this issue - half a dozen mentioned in this thread already (PS: PSPad also works fine).

Regards
Dalai
#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
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: [9.51] Create new file (with space in name and without extension) confirmation dialog

Post by *MVV »

Well, the dot is for explicitly empty extension, otherwise some editors may want to append ".txt" to filename. But path like "M:\a a." is absolutely correct.

However last TC version really does a strange thing, it adds a dot AFTER closing quote.

Code: Select all

C:\Windows\notepad.exe "D:\a a".
So I confirm a bug in Total Commander!

Classic command line processing rules allow quoting parts of arguments: argument ends at the first unquoted space (quoted parts should be unqouted during argument extraction), but there is no reason to do so in TC and it is rather a bug than an intended behaviour.
All apps that use MSVC runtime and some other apps handle it, but it seems that AkelPad's custom command line parser doesn't expect this. And I can guess that it treats the dot as a next file path, just like if there was a space before it, hence it opens first passed file ("M:\a a") and it fails to open second one (".", dot means current directory so it ends up with "M:\").

Happily this only happens when editor path only contains path to editor w/o arguments and doesn't happen when "%1" is in it.
Also I see an inconsistence:
1. When file "a a" exists, TC just passes its path to editor w/o trailing dot.
2. When file "a a" doesn't exist, TC creates the file and then passes its path with trailing dot.
I.e. in both cases editor gets existing file, but only in one case the dot is added to filename. I believe that one of two branches may be removed and stable behaviour (either appending dot or not appending) may be used regardless of file existence.

anton-09,
Please set the following as an editor path, this should bypass your problem:

Code: Select all

"%COMMANDER_PATH%\PLUGINS\EXE\AkelPad\Akelpad.exe" "%1"
anton-09
Junior Member
Junior Member
Posts: 3
Joined: 2020-08-13, 16:59 UTC

Re: [9.51] Create new file (with space in name and without extension) confirmation dialog

Post by *anton-09 »

Some magic in source code? :D
MVV, your proposed editor string worked:

Code: Select all

"%COMMANDER_PATH%\PLUGINS\EXE\AkelPad\Akelpad.exe" "%1"
Now file "a a" is created with trailing dot inside quotes:

Code: Select all

"C:\PortableApps\TotalCmd\PLUGINS\EXE\AkelPad\Akelpad.exe" "m:\a a."
Thanks!
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [9.51] Create new file (with space in name and without extension) confirmation dialog

Post by *Dalai »

MVV wrote: 2020-08-14, 05:10 UTCHappily this only happens when editor path only contains path to editor w/o arguments and doesn't happen when "%1" is in it.
Huh, interesting. I can confirm this, too. This explains why I didn't catch the different behavior in the various TC versions (I set the editor via the Browse button, which automatically adds "%1" to the command line). Note that it doesn't matter if "%1" is present for TC 8.52a - that version always adds the dot before the closing quote.

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

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply