mirror of https://github.com/jumpserver/jumpserver
Merge branch 'dev' of git.coding.net:jumpserver/jumpserver into dev
commit
d6b4c7c485
10
connect.py
10
connect.py
|
@ -435,14 +435,22 @@ class SshTty(Tty):
|
||||||
# 发起ssh连接请求 Make a ssh connection
|
# 发起ssh连接请求 Make a ssh connection
|
||||||
ssh = self.get_connection()
|
ssh = self.get_connection()
|
||||||
|
|
||||||
|
transport = ssh.get_transport()
|
||||||
|
transport.set_keepalive(30)
|
||||||
|
transport.use_compression(True)
|
||||||
|
|
||||||
# 获取连接的隧道并设置窗口大小 Make a channel and set windows size
|
# 获取连接的隧道并设置窗口大小 Make a channel and set windows size
|
||||||
global channel
|
global channel
|
||||||
win_size = self.get_win_size()
|
win_size = self.get_win_size()
|
||||||
self.channel = channel = ssh.invoke_shell(height=win_size[0], width=win_size[1], term='xterm')
|
#self.channel = channel = ssh.invoke_shell(height=win_size[0], width=win_size[1], term='xterm')
|
||||||
|
self.channel = channel = transport.open_session()
|
||||||
|
channel.get_pty(term='xterm',height=win_size[0],width=win_size[1])
|
||||||
|
channel.invoke_shell()
|
||||||
try:
|
try:
|
||||||
signal.signal(signal.SIGWINCH, self.set_win_size)
|
signal.signal(signal.SIGWINCH, self.set_win_size)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.posix_shell()
|
self.posix_shell()
|
||||||
|
|
||||||
# Shutdown channel socket
|
# Shutdown channel socket
|
||||||
|
|
Loading…
Reference in New Issue