From 32ab8a1646724cf2cdef94d4eabdda7cff95b7dd Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 11 May 2016 18:48:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E7=BE=8E=E4=BF=AE=E5=A4=8Dvim?= =?UTF-8?q?=E7=AD=89=E4=BA=A4=E4=BA=92=E5=BC=8F=E5=91=BD=E4=BB=A4=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=20(#236)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(api) 修改建立目录的bug 使用bash代替python完成建立777目录的功能 * fix passwd input * fix(mkdir) 修改mkdirs策略 修改原来导致的bug * fix passwd input (#232) 修复记录敏感密码bug * fix passwd input * fix passwd input * fix passwd input --- run_server.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/run_server.py b/run_server.py index 416c86f70..51c080529 100755 --- a/run_server.py +++ b/run_server.py @@ -373,15 +373,13 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler): self.termlog.recoder = True self.term.input_mode = True if str(jsondata['data']) in ['\r', '\n', '\r\n']: - if self.term.vim_flag: - match = re.compile(r'\x1b\[\?1049', re.X).findall(self.term.vim_data) - if match: - if self.term.vim_end_flag or len(match) == 2: - self.term.vim_flag = False - self.term.vim_end_flag = False - else: - self.term.vim_end_flag = True - else: + match = re.compile(r'\x1b\[\?1049', re.X).findall(self.term.vim_data) + if match: + if self.term.vim_flag or len(match) == 2: + self.term.vim_flag = False + else: + self.term.vim_flag = True + elif not self.term.vim_flag: result = self.term.deal_command(self.term.data)[0:200] if len(result) > 0: TtyLog(log=self.log, datetime=datetime.datetime.now(), cmd=result).save() @@ -424,8 +422,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler): if not len(recv): return data += recv - if self.term.vim_flag: - self.term.vim_data += recv + self.term.vim_data += recv try: self.write_message(data.decode('utf-8', 'replace')) self.termlog.write(data) @@ -436,7 +433,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler): pre_timestamp = now_timestamp self.log_file_f.flush() self.log_time_f.flush() - if self.term.input_mode and not self.term.is_output(data): + if self.term.input_mode: self.term.data += data data = '' except UnicodeDecodeError: