[TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"
Moderators: petermad, Stefan2, white, Hacker
[TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"
(Issue mentioned earlier here)
Create a button with this cm_Edit command:
cm_Edit /GCN="<test[Q]"
[Q] is not an allowed placeholder at this time, so this is a syntax error in the filename specification and executing the command shows the new file dialog with "<Error!>" in the preview.
Pressing Shift+F4 and typing "<test[Q]", causes the error to be displayed as well.
Now change the button mentioned before by removing "GC", so it leaves this command:
cm_Edit /N="<test[Q]"
Despite the syntax error in the filename specification, this results in "d:\somedir\<test[Q]" being passed to the editor. In my opinion, that shouldn't happen.
Create a button with this cm_Edit command:
cm_Edit /GCN="<test[Q]"
[Q] is not an allowed placeholder at this time, so this is a syntax error in the filename specification and executing the command shows the new file dialog with "<Error!>" in the preview.
Pressing Shift+F4 and typing "<test[Q]", causes the error to be displayed as well.
Now change the button mentioned before by removing "GC", so it leaves this command:
cm_Edit /N="<test[Q]"
Despite the syntax error in the filename specification, this results in "d:\somedir\<test[Q]" being passed to the editor. In my opinion, that shouldn't happen.
- ghisler(Author)
- Site Admin

- Posts: 52921
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"
Without "C", this goes to the function which directly opens a file, e.g. because you pressed F4 on it. Therefore it doesn't do any name checks.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"
Doesn't do any name checks? So using valid placeholders doesn't work? For example:ghisler(Author) wrote: 2026-05-08, 15:09 UTC Without "C", this goes to the function which directly opens a file, e.g. because you pressed F4 on it. Therefore it doesn't do any name checks.
cm_Edit /N="<test[YMD]"
This seems to work fine. It doesn't pass "d:\somedir\<test[YMD]" to the editor.
And regardless of how you currently implemented this, don't you agree that you should never pass "d:\somedir\<test[Q]" to the editor?
- ghisler(Author)
- Site Admin

- Posts: 52921
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"
It does not check for errors - the user will get the error when the file couldn't be opened. How is that worse than just showing <Error!>?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"
"d:\somedir\<test[Q]" is clearly not a valid filename, and it is unknown how the user's editor will handle that. Not starting the editor or starting the editor without a filename would be better than sending that.ghisler(Author) wrote: 2026-05-10, 08:01 UTC It does not check for errors - the user will get the error when the file couldn't be opened. How is that worse than just showing <Error!>?
Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"
Tested OK with TC 11.57a pre1 32-bit and 64bit. Error shown: "Invalid file name specified!" (followed by the name specification)11.05.26 Fixed: cm_Edit with invalid name parameter, e.g. /GN="<test[Q]" now shows an error instead of opening the file (32/64)
Including the "G" in the example (/GN="<test[Q]") is redundant and may be confusing.
- ghisler(Author)
- Site Admin

- Posts: 52921
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"
You are right, I will remove the G from the history entry.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin

- Posts: 52921
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"
Please re-check with Total Commander 11.57a RC1!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"
Tested OK using TC 11.57a rc1 32-bit and 64-bit.
Moderator message from: white » 2026-05-20, 14:17 UTC
Moved topic
» from TC11.x bug reports (English) to TC Fixed bugs
» from TC11.x bug reports (English) to TC Fixed bugs
