mirror of https://github.com/jumpserver/jumpserver
fix: command recoder bug fix
parent
0b05899818
commit
f1ff52eb6b
|
@ -351,18 +351,18 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def on_message(self, message):
|
def on_message(self, message):
|
||||||
data = json.loads(message)
|
jsondata = json.loads(message)
|
||||||
if not data:
|
if not jsondata:
|
||||||
return
|
return
|
||||||
|
|
||||||
if 'resize' in data.get('data'):
|
if 'resize' in jsondata.get('data'):
|
||||||
self.channel.resize_pty(
|
self.channel.resize_pty(
|
||||||
data.get('data').get('resize').get('cols', 80),
|
jsondata.get('data').get('resize').get('cols', 80),
|
||||||
data.get('data').get('resize').get('rows', 24)
|
jsondata.get('data').get('resize').get('rows', 24)
|
||||||
)
|
)
|
||||||
elif data.get('data'):
|
elif jsondata.get('data'):
|
||||||
self.term.input_mode = True
|
self.term.input_mode = True
|
||||||
if str(data['data']) in ['\r', '\n', '\r\n']:
|
if str(jsondata['data']) in ['\r', '\n', '\r\n']:
|
||||||
if self.term.vim_flag:
|
if self.term.vim_flag:
|
||||||
match = self.term.ps1_pattern.search(self.term.vim_data)
|
match = self.term.ps1_pattern.search(self.term.vim_data)
|
||||||
if match:
|
if match:
|
||||||
|
@ -377,7 +377,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
|
||||||
self.term.vim_data = ''
|
self.term.vim_data = ''
|
||||||
self.term.data = ''
|
self.term.data = ''
|
||||||
self.term.input_mode = False
|
self.term.input_mode = False
|
||||||
self.channel.send(data['data'])
|
self.channel.send(jsondata['data'])
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue