From 9efa9e979c7ca2fa1b0f8b1b7d8801513aceaf6e Mon Sep 17 00:00:00 2001 From: liuzheng712 Date: Fri, 18 Mar 2016 23:51:25 +0800 Subject: [PATCH] len(vim_data) --- run_server.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/run_server.py b/run_server.py index c15ab9b5c..baf53e1c7 100755 --- a/run_server.py +++ b/run_server.py @@ -370,9 +370,11 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler): vim_data = self.term.deal_command(self.term.vim_data)[0:200] if len(data) > 0: TtyLog(log=self.log, datetime=datetime.datetime.now(), cmd=vim_data).save() - - TtyLog(log=self.log, datetime=datetime.datetime.now(), - cmd=self.term.deal_command(self.term.data)[0:200]).save() + else: + vim_data = self.term.deal_command(self.term.vim_data)[0:200] + if len(vim_data) > 0: + TtyLog(log=self.log, datetime=datetime.datetime.now(), + cmd=vim_data).save() self.term.vim_data = '' self.term.data = '' self.term.input_mode = False