Fast-open of PuTTY in current directory
could you add a config-attribute to Options->Preferences->Integration->Applications->PuTTY, so that the Button will open PuTTY in the current directory?
I would love it!
Greetings,
someguest
Advertisement
Advertisement
CreateProcess()
with the Command
putty -ssh telnet://$ip -l $username -pw $pass
cd $dir
to the Thread-ID with the PostThreadMessage
function: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postthreadmessagew
c:\kitty\kitty.exe -ssh user@host -pw "password" -cmd "cd $REMOTE_PATH$"
Advertisement
"D:\PortableApps\KittyPortable\kitty_portable.exe" -ssh !U@!@ -pw "!P" -cmd "cd !/"
So perhaps one could make a batch file which would receive the username, hostname, and path from its command line arguments passed to it from a WinSCP Custom Command. Then it would echo3.8.3.6 -m: read a remote command or script from a file
The-m
option performs a similar function to the "Remote command" box in the SSH panel of the PuTTY configuration box (see section 4.18.1). However, the-m
option expects to be given a local file name, and it will read a command from that file.
cd
and path to a temp file. And then run putty.exe with the username, hostname, and the temp file.
Advertisement
I've been testing this. It seems pretty unreliable. Obviously, what it does is that it simulates the keystrokes to type the command. I guess that it often starts typing too early, before the remote session starts reading; and the keystrokes end in vain.what about using KiTTY instead of PuTTY and utilizing KiTTY's ability to execute commands after login ?
at least supporting this option would be nicec:\kitty\kitty.exe -ssh user@host -pw "password" -cmd "cd $REMOTE_PATH$"
This (as opposite to KiTTY simulating keystrokes) makes PuTTY instruct SSH server to start that command instead of the shell. Once that command finishes, the session is terminated. So WinSCP would have to know how to start a shell and append the shell starting command after thePutty.exe has a similar argument to run a command but it has to be read from a file and cannot be passed directly on the command-line:
cd
.
I reported this to KiTTY forums and they replied that the fix for this is to increase the initial delay before it starts typing.I've been testing this. It seems pretty unreliable. Obviously, what it does is that it simulates the keystrokes to type the
command. I guess that it often starts typing too early, before the remote session starts reading; and the keystrokes end in vain.
Advertisement
Btw, theI reported this to KiTTY forums and they replied that the fix for this is to increase the initial delay before it starts typing.
https://www.9bis.net/kitty/#!pages/AutomaticCommand.md
-cmd
switch cannot be combined with -load
. What limits its usability for exporting sessions from WinSCP to KiTTY.
Btw, the-cmd
switch cannot be combined with-load
. What limits its usability for exporting sessions from WinSCP to KiTTY.
-load
is used, it reads the cmd from the "Autocommand"
data key as defined in the session.
"KittyPortable\Sessions\Default%20Settings"
as "KittyPortable\Sessions\WinSCPTemporarySession"
.
"KittyPortable\Sessions\WinSCPTemporarySession"
HostName
UserName
Password
PublicKeyFile
(if password is blank)
Autocommand
kitty_portable.exe -load "WinSCPTemporarySession"
You can use Pageant instead.In addition to the !p password custom command pattern, it would be helpful if you could also implement a WinSCP custom command pattern to pass the private key file path to a custom command line.
Advertisement
Not really. Just tried 5.2.2 beta. It will open the current session but not switch to the current directory.Implemented in 5.2.2 beta and released today :-)
[HKEY_CURRENT_USER\Software\9bis.com\KiTTY\Sessions\WinSCP%20temporary%20session]
"<pathtoputty>" -load "WinSCP temporary session"
cd "$REMOTE_PATH$"
[HKEY_CURRENT_USER\Software\9bis.com\KiTTY\Sessions\WinSCP%20temporary%20session]
Please read documentation:Idea: Preferences>Integration>Applications could have an input box for "Autocommand" where we could specify:cd "$REMOTE_PATH$"
If specified, then Autocommand reg value would also get written to[HKEY_CURRENT_USER\Software\9bis.com\KiTTY\Sessions\WinSCP%20temporary%20session]
RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\9bis.com\KiTTY\Sessions\WinSCP`%20temporary`%20session, Autocommand, cd "%1%" Run, kitty.exe -load "WinSCP Temporary Session"
WinSCPLaunchKittyTempsession.exe "!/"
Software\9bis.com\KiTTY
Advertisement
You can post new topics in this forum