VanDyke Software

Tips

Index

Using an Escape Sequence with the SecureCRT® SFTP Tab

If you need to open an SFTP tab to the same directory you're working on in your terminal window, you can eliminate some typing by using an escape sequence which will allow you to use relative paths, rather than the file menu or ALT+P (Command+P on the Mac) accelerator. This tip assumes you're using an SSH2 session.

Here is an example of how to set up and use an sftp-session escape sequence that opens an SFTP tab in your current server-side working directory.

  1. In SecureCRT, go to Global Options / Terminal / Advanced and check "Enable execute escape sequence" in the Options group.
  2. Next, set up an alias, shell script, Perl script, or other mechanism that will pass your current directory as an argument in a command. In this example, the alias will be named "sftptab".

    Send the following escape sequence from the remote system to open the tab window. (You need to specify the current working directory because SecureCRT doesn't know what directory you are currently in on the remote side):
    <esc>&&Bsftp-session <directory to open in>\n

    Under UNIX, you can use the following command:

    echo "^[&&Bsftp-session `pwd`"

    Note: To get the "^[" characters, type "CTRL+V","CTRL+[".

  3. Now that you have your alias "sftptab" set up, you can use the following escape sequence to open a new SFTP tab in your current working directory:

    % pwd
    /home/user/some/directory/that/would/take/a/lot/of/typing/to/cd/in/to
    % sftptab
    <New tab opens>
    sftp> pwd
    /home/user/some/directory/that/would/take/a/lot/of/typing/to/cd/in/to