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
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\"...
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.
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?
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.
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...
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.
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.
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.
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.
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.