[TC11.03] CD command needs to be capitalized

Bug reports will be moved here when the described bug has been fixed

Moderators: Hacker, petermad, Stefan2, white

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

Re: [TC11.03] CD command needs to be capitalized

Post by *Dalai »

JOUBE wrote: 2024-07-16, 17:44 UTCAnyone who uses plugins and has even a little overview will immediately understand the connections and be able to organize them
The existence of this very thread contradicts your statement. Probably only a small portion of people using WFX plugins know about the possibility to execute commands in the plugin context. I'd go even further and allege that not even all WFX plugin developers know about this feature.
That's just ridiculous.
Documenting functionality for everyone to read and learn from is ridiculous? Sure, smarty-pants...

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
jonathanpoulin
Member
Member
Posts: 131
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

Re: [TC11.03] CD command needs to be capitalized

Post by *jonathanpoulin »

JOUBE wrote: 2024-07-16, 17:44 UTC Anyone who uses plugins and has even a little overview will immediately understand the connections and be able to organize them, instead of creating a bug report here. That's just ridiculous.
Ok, my post is ridiculous...

Anyway, as a user of TC I think IMHO it is highly unexpected than the 2 commands below act differently, especially if this is not documented anywhere. From my first post... again, I am in "\\\Secure FTP\"...

Code: Select all

cd \\\Registry\

Code: Select all

CD \\\Registry\
...do 2 different things...
Thanks,
Jonathan Poulin
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC11.03] CD command needs to be capitalized

Post by *ghisler(Author) »

It's not a bug, it depends on whether a plugin can handle a command line by itself or not. TC sends the command FsExecuteFile with parameter "quote" to the plugin. From the description for plugin writers:
quote commandline: Execute the command line entered by the user in the directory RemoteName . This is called when the user enters a command in Totalcmd's command line, and presses ENTER. This is optional, and allows to send plugin-specific commands. It's up to the plugin writer what to support here. If the user entered e.g. a cd directory command, you can return the new path in RemoteName (max 259 characters), and give FS_EXEC_SYMLINK as return value. Return FS_EXEC_OK to cause a refresh (re-read) of the active panel.

So the plugin can return FS_EXEC_SYMLINK to redirect the user to the new location. Or it can return FS_EXEC_OK when it for example created a new file, and TC needs to re-read the directory. The plugin can also return FS_EXEC_YOURSELF if it doesn't know what it should do with the command, and let TC handle it. And that's exactly what happens when you use an uppercase CD command.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5744
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC11.03] CD command needs to be capitalized

Post by *white »

2ghisler(Author)
So, you don't think it should be documented on the Help page about TC's command line and on the Help page about the built-in FTP client?
User avatar
jonathanpoulin
Member
Member
Posts: 131
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

Re: [TC11.03] CD command needs to be capitalized

Post by *jonathanpoulin »

ghisler(Author) wrote: 2024-07-18, 14:11 UTC It's not a bug, it depends on whether a plugin can handle a command line by itself or not. TC sends the command FsExecuteFile with parameter "quote" to the plugin. From the description for plugin writers:
quote commandline: Execute the command line entered by the user in the directory RemoteName . This is called when the user enters a command in Totalcmd's command line, and presses ENTER. This is optional, and allows to send plugin-specific commands. It's up to the plugin writer what to support here. If the user entered e.g. a cd directory command, you can return the new path in RemoteName (max 259 characters), and give FS_EXEC_SYMLINK as return value. Return FS_EXEC_OK to cause a refresh (re-read) of the active panel.

So the plugin can return FS_EXEC_SYMLINK to redirect the user to the new location. Or it can return FS_EXEC_OK when it for example created a new file, and TC needs to re-read the directory. The plugin can also return FS_EXEC_YOURSELF if it doesn't know what it should do with the command, and let TC handle it. And that's exactly what happens when you use an uppercase CD command.
Thank Mr. Ghisler for all the details. I know now that's not a bug.
Thanks,
Jonathan Poulin
User avatar
jonathanpoulin
Member
Member
Posts: 131
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

Re: [TC11.03] CD command needs to be capitalized

Post by *jonathanpoulin »

jonathanpoulin wrote: 2024-07-18, 17:30 UTC
ghisler(Author) wrote: 2024-07-18, 14:11 UTC It's not a bug, it depends on whether a plugin can handle a command line by itself or not. TC sends the command FsExecuteFile with parameter "quote" to the plugin. From the description for plugin writers:
quote commandline: Execute the command line entered by the user in the directory RemoteName . This is called when the user enters a command in Totalcmd's command line, and presses ENTER. This is optional, and allows to send plugin-specific commands. It's up to the plugin writer what to support here. If the user entered e.g. a cd directory command, you can return the new path in RemoteName (max 259 characters), and give FS_EXEC_SYMLINK as return value. Return FS_EXEC_OK to cause a refresh (re-read) of the active panel.

So the plugin can return FS_EXEC_SYMLINK to redirect the user to the new location. Or it can return FS_EXEC_OK when it for example created a new file, and TC needs to re-read the directory. The plugin can also return FS_EXEC_YOURSELF if it doesn't know what it should do with the command, and let TC handle it. And that's exactly what happens when you use an uppercase CD command.
Thank Mr. Ghisler for all the details. I know now that's not a bug.
I just realized the "CD" (in uppercase) command is a "Command with Parameters". I see now... :)
Thanks,
Jonathan Poulin
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC11.03] CD command needs to be capitalized

Post by *ghisler(Author) »

So, you don't think it should be documented on the Help page about TC's command line and on the Help page about the built-in FTP client?
I didn't say that. How does the following sound?
When the active panel shows a directory from an FTP server, the command will be sent to that server. On most servers you can send the HELP command to get a list of supported commands.

When the active panel shows a directory from a file system plugin like SFTP, the command will be first sent to the plugin. If the plugin doesn't want to handle the command, Total Commander will try to handle it by itself. For example, cd directory will be handled directly by the SFTP plugin, but CD directory (uppercase) will be handled by Total Commander.
Anything else to add?
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5744
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC11.03] CD command needs to be capitalized

Post by *white »

ghisler(Author) wrote: 2024-07-19, 08:21 UTC ..How does the following sound?
When the active panel shows a directory from an FTP server, the command will be sent to that server. On most servers you can send the HELP command to get a list of supported commands.

When the active panel shows a directory from a file system plugin like SFTP, the command will be first sent to the plugin. If the plugin doesn't want to handle the command, Total Commander will try to handle it by itself. For example, cd directory will be handled directly by the SFTP plugin, but CD directory (uppercase) will be handled by Total Commander.
Anything else to add?
How about:
When viewing an FTP directory in the active panel, commands are sent directly to the FTP server. Users can typically use the HELP command on most FTP servers to retrieve a list of available commands. The cd command (lowercase) is translated by Total Commander to the appropriate FTP command and sent to the server. The CD command (uppercase) is executed as a regular cd command within Total Commander.

When the active panel displays a directory from a file system plugin (e.g., SFTP), commands are initially sent to the plugin. If the plugin doesn't handle the command, Total Commander will process it. For example, 'cd directory' (lowercase) is handled by the SFTP plugin, but 'CD directory' (uppercase) is handled by Total Commander. But this really depends on the implementation of the particular plugin.
Add on the FTP help page, add at the end of the first paragraph:
The [command line] can be used to send commands directly to the FTP server.
Where [command line] is a link to the help page about the command line.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC11.03] CD command needs to be capitalized

Post by *petermad »

So far I wote for white's description.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC11.03] CD command needs to be capitalized

Post by *ghisler(Author) »

Thanks for the improvement!
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC11.03] CD command needs to be capitalized

Post by *ghisler(Author) »

This has been added to the help, please check it!
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5744
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC11.03] CD command needs to be capitalized

Post by *white »

I can confirm that the suggested text for the help page "Command line" was added to the help.

Perhaps this part:
The cd command (lowercase) is translated by Total Commander to the appropriate FTP command and sent to the server. The CD command (uppercase) is executed as a regular cd command within Total Commander.
should also be added to:
[Help - FTP] wrote: - Send commands directly to the FTP server?
Just type the command in the command line of Total Commander, and press ENTER. Make sure the active file window shows a current FTP connection! The following commands are intercepted by Total Commander, and executed directly: GET, PUT, RETR, STOR. You can use the command HELP to get a list of supported commands.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC11.03] CD command needs to be capitalized

Post by *ghisler(Author) »

Good idea. I will add a hint that it's for changing directories, e.g.
The cd command (lowercase) to change directories is translated by Total Commander to the appropriate FTP command and sent to the server. The CD command (uppercase) is executed as a regular cd command within Total Commander.
Author of Total Commander
https://www.ghisler.com
JOUBE
Power Member
Power Member
Posts: 1664
Joined: 2004-07-08, 08:58 UTC

Re: [TC11.03] CD command needs to be capitalized

Post by *JOUBE »

ghisler(Author) wrote: 2024-10-10, 08:47 UTC Good idea. I will add a hint that it's for changing directories, e.g.
The cd command (lowercase) to change directories is translated by Total Commander to the appropriate FTP command and sent to the server. The CD command (uppercase) is executed as a regular cd command within Total Commander.
This is complete nonsense. If there is a CD (in uppercase) command on the server, it would be executed on the server *). I really don't understand what ist going on here. And second, this is not only with FTP but also with SFTP-Plugin.

*) ... and if this behavior were not so, it would be a serious mistake.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC11.03] CD command needs to be capitalized

Post by *ghisler(Author) »

???
Author of Total Commander
https://www.ghisler.com
Post Reply