Commit a5044a34 by fwkz

minor refactor of ssh_interactive()

parent a58e1983
......@@ -446,23 +446,23 @@ def boolify(value):
def ssh_interactive(ssh):
chan = ssh.invoke_shell()
try:
import termios
import tty
if os.name == 'posix':
posix_shell(chan)
except:
else:
windows_shell(chan)
def posix_shell(chan):
import termios
import tty
oldtty = termios.tcgetattr(sys.stdin)
try:
tty.setraw(sys.stdin.fileno())
tty.setcbreak(sys.stdin.fileno())
chan.settimeout(0.0)
while(True):
while True:
r, w, e = select.select([chan, sys.stdin], [], [])
if chan in r:
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment