1
# Copyright (C) 2003-2005 Robey Pointer <robey@lag.net>
3
# This file is part of paramiko.
5
# Paramiko is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU Lesser General Public License as published by the Free
7
# Software Foundation; either version 2.1 of the License, or (at your option)
10
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15
# You should have received a copy of the GNU Lesser General Public License
16
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
17
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23
# windows does not have termios...
32
def interactive_shell(chan):
39
def posix_shell(chan):
42
oldtty = termios.tcgetattr(sys.stdin)
44
tty.setraw(sys.stdin.fileno())
45
tty.setcbreak(sys.stdin.fileno())
49
r, w, e = select.select([chan, sys.stdin], [], [])
54
print '\r\n*** EOF\r\n',
58
except socket.timeout:
67
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, oldtty)
70
# thanks to Mike Looijmans for this code
71
def windows_shell(chan):
74
sys.stdout.write("Line-buffered terminal emulation. Press F6 or ^Z to send EOF.\r\n\r\n")
80
sys.stdout.write('\r\n*** EOF ***\r\n\r\n')
83
sys.stdout.write(data)
86
writer = threading.Thread(target=writeall, args=(chan,))