When I open Xftp from Xshell, I get the "Cannot display the remote folder" message

PROBLEM DESCRIPTION


After you connect to remote host via SSH and click on the Xftp icon on the Xshell standard toolbar, the following error message:

Cannot display the remote folder.

Xftp log shows:
STATUS:> Sent password.
STATUS:> Access granted.
STATUS:> SFTP version 3 negotiated.
STATUS:>Listing folder '/~'...
ERROR:> Listing folder failed.
STATUS:> Listing folder ''...
STATUS:> Listing folder completed.

RESOLUTION


When a user clicks on the Xftp icon, Xshell retrieves the current working directory information from terminal and passes it to Xftp. If the current directory is the user's home directory, '~' is passed instead of the full path which is common in terminal.
The problem is that Xshell cannot translate '~' into the real directory path. When '~' is passed to Xftp, Xftp tries to open the path ('~') but SFTP does not recognize this path so returns an error.
Xftp opens the user's home directory when this error occurs.