mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-02 07:55:16 +00:00
修改 foo.setwinsize()
This commit is contained in:
@@ -62,7 +62,10 @@ class PyCrypt(object):
|
||||
def sigwinch_passthrough(sig, data):
|
||||
"""This function use to set the window size of the terminal!"""
|
||||
winsize = getwinsize()
|
||||
try:
|
||||
foo.setwinsize(winsize[0], winsize[1])
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def getwinsize():
|
||||
@@ -118,11 +121,9 @@ def connect(host, port, user, password):
|
||||
foo.logfile = logfile
|
||||
foo.sendline('')
|
||||
signal.signal(signal.SIGWINCH, sigwinch_passthrough)
|
||||
size = getwinsize()
|
||||
foo.setwinsize(size[0], size[1])
|
||||
foo.interact()
|
||||
foo.interact(escape_character=chr(28))
|
||||
except pxssh.ExceptionPxssh as e:
|
||||
print('密码错误: %s' % e)
|
||||
print('登录失败: %s' % e)
|
||||
except KeyboardInterrupt:
|
||||
foo.logout()
|
||||
|
||||
|
Reference in New Issue
Block a user