Commit b6f82ca0 authored by ibuler's avatar ibuler

修复vim修改窗口大小中断bug

parent 81a6f484
...@@ -415,7 +415,10 @@ class SshTty(Tty): ...@@ -415,7 +415,10 @@ class SshTty(Tty):
pass pass
if sys.stdin in r: if sys.stdin in r:
x = os.read(sys.stdin.fileno(), 4096) try:
x = os.read(sys.stdin.fileno(), 4096)
except OSError:
pass
input_mode = True input_mode = True
if str(x) in ['\r', '\n', '\r\n']: if str(x) in ['\r', '\n', '\r\n']:
if self.vim_flag: if self.vim_flag:
...@@ -803,7 +806,7 @@ def main(): ...@@ -803,7 +806,7 @@ def main():
color_print('请输入正确ID', 'red') color_print('请输入正确ID', 'red')
except ServerError, e: except ServerError, e:
color_print(e, 'red') color_print(e, 'red')
except Exception, e: except IndexError, e:
color_print(e) color_print(e)
time.sleep(5) time.sleep(5)
pass pass
......
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