[9.51] Create new file (with space in name and without extension) confirmation dialog
Moderators: Hacker, petermad, Stefan2, white
[9.51] Create new file (with space in name and without extension) confirmation dialog
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.
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.
Re: [9.51] Create new file (with space in name and without extension) confirmation dialog
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?
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?
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: [9.51] Create new file (with space in name and without extension) confirmation dialog
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
Re: [9.51] Create new file (with space in name and without extension) confirmation dialog
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
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
-
- 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
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:
(no space or dot after the last "a")
(a dot after the last "a")
(a space after the last "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?
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"
Code: Select all
"C:\whatever_the_path_to_your_AkelPad.exe" "m:\a a."
Code: Select all
"C:\whatever_the_path_to_your_AkelPad.exe" "m:\a a "
Code: Select all
"C:\whatever_the_path_to_your_AkelPad.exe" "m:\a 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?
Re: [9.51] Create new file (with space in name and without extension) confirmation dialog
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:
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".
Re: [9.51] Create new file (with space in name and without extension) confirmation dialog
Confirmed. Somehow I missed that difference between TC versions, although I saw the trailing dot (as I mentioned above).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
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).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
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: [9.51] Create new file (with space in name and without extension) confirmation dialog
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.
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:
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".
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"
Re: [9.51] Create new file (with space in name and without extension) confirmation dialog
Some magic in source code?
MVV, your proposed editor string worked:
Now file "a a" is created with trailing dot inside quotes:
Thanks!

MVV, your proposed editor string worked:
Code: Select all
"%COMMANDER_PATH%\PLUGINS\EXE\AkelPad\Akelpad.exe" "%1"
Code: Select all
"C:\PortableApps\TotalCmd\PLUGINS\EXE\AkelPad\Akelpad.exe" "m:\a a."
Re: [9.51] Create new file (with space in name and without extension) confirmation dialog
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.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.
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror