Everytime I try to use winpexpect to spawn terminal (eg: openssh, ssh
). if I do winpexpect.winspawn('ssh ...')
I am met with "Pseudo-terminal will not be allocated because stdin is not a terminal.". If I force a terminal using winpexpect.winspawn('ssh -t -t ...')
then I just get nothing in my read buffer, even though the ssh client REALLY is connecting to the server. The same goes with other interactive terminals, they just hang and nothing shows up in the read buffer. However for commands that terminal, such as ping
winpexpect works.
What I have found that does actually work is using putty's plink.exe, winpexpect.winspawn('plink ...'
. This is the same as putty.exe, but it doesn't do terminal emulation, I just get the raw telnet/decrypted ssh data. However this isn't really ideal solution.
I am really stuck at how to get get a spawner/expect library to work with terminals on windows! I have even tried using expectJ, just pure Java, and that too has the same issue.