TCs command line: Parsing TAB chars problem ?
Moderators: Hacker, petermad, Stefan2, white
TCs command line: Parsing TAB chars problem ?
I'm not quite sure if this should be reported as a bug or a suggestion, but I decided to place it here.
Tested with TC 9.0 beta3 32-bit:
1) I assume here, that "c:\windows" folder exists.
2) Open Notepad.exe and write the following text: cd c:\windows (important: place only one TAB character, not SPACES, between "cd" and "c:\windows").
3) Copy this text to the clipboard, paste to the TC's command line and try to execute. A "File not found!" error appears.
After pasting this text to a cmd.exe window, command is executed properly.
I found this problem when pasting some commands from a formatted TXT or PDF file.
Solution: replace all TAB chars with spaces before parsing the command line.
Regards
Tested with TC 9.0 beta3 32-bit:
1) I assume here, that "c:\windows" folder exists.
2) Open Notepad.exe and write the following text: cd c:\windows (important: place only one TAB character, not SPACES, between "cd" and "c:\windows").
3) Copy this text to the clipboard, paste to the TC's command line and try to execute. A "File not found!" error appears.
After pasting this text to a cmd.exe window, command is executed properly.
I found this problem when pasting some commands from a formatted TXT or PDF file.
Solution: replace all TAB chars with spaces before parsing the command line.
Regards
It's always a good idea to paste some command taken from unknown and/or unreliable sources into an editor before pasting them into the command line. Web sites can manipulate clipboard contents so you may not necessarily be copying the contents into the clipboard you think you are copying (the text you marked). See for example this thread on StackOverflow.
Yes, I know that web sites are not PDFs or some documents but the same principle applies. PDFs may even contain script elements, too.
Regards
Dalai
Yes, I know that web sites are not PDFs or some documents but the same principle applies. PDFs may even contain script elements, too.
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
MVV wrote:It is not a bug definitely because space is a delimiter in Windows, not tab, and it will not work in most programs with tabs, e.g. in Win+R dialog.
Just for compatibility reasons, TC's command line should be able to execute commands, that can be executed in a console window (cmd.exe). Please note, that cmd.exe CAN execute BAT scripts with TABs. After pasting some command from a BAT file to the TC's command line, it would be nice to have this command executed.Horst.Epp wrote:[...] no one (except you) uses tabs in Windows command lines.
Or discussion took at least 10 minutes, but the issue can be handled in one minute

Code: Select all
for I:=1 to Length(CommandLine) do
if CommandLine[I] = #9 then
CommandLine[I]:=' ';
- ghisler(Author)
- Site Admin
- Posts: 50550
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Indeed tabs are not supported in cd command in command line, since you can't enter them there anyway. TC expects spaces as delimiters.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I mean, do you indent not commands itself but command parameters? The former one I can understand but not the latter one...
Code: Select all
cd %TEMP%
Code: Select all
cd %TEMP
I have used tabs often in batch
and had never an issue with that.
But I would never use tabs in an command line itself.
And I would not expect an file manager to be that smart to saves me.
But it would not hurt either.
OTOH there are more important things to work on.
Code: Select all
for x in (y) do (
Echo x
Copy x C:\temp
)
Echo abc > x
Echo defgh ikl mno >> x
and had never an issue with that.
But I would never use tabs in an command line itself.
And I would not expect an file manager to be that smart to saves me.
But it would not hurt either.
OTOH there are more important things to work on.
IMHO, since tabs are supported in windows command line, they should also be supported in TC. They may not be directly insertable but since one can paste them from a batch file (in which they are supported), they should also work normally in TC.MarcinW wrote:That's just the point - TC currently doesn't expect TABs as delimiters, but TABs can be pasted from a BAT file.
TC could just replace each TAB character with a single space just before pasting or executing the command-line statement (whichever one is easier).
- Wanderer -
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.