pull/123/head
liuzheng712 2016-03-04 23:57:39 +08:00
parent bdf6d97478
commit 210b3c8588
3 changed files with 6 additions and 5 deletions

View File

@ -384,9 +384,6 @@ class SshTty(Tty):
if self.channel in r:
try:
x = self.channel.recv(10240)
print x
print '===='
print len(x)
if len(x) == 0:
break
if self.vim_flag:

View File

@ -412,7 +412,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
if self.term.vim_flag:
self.term.vim_data += recv
try:
self.write_message(json.dumps({'data': data}))
self.write_message(data)
now_timestamp = time.time()
self.log_time_f.write('%s %s\n' % (round(now_timestamp-pre_timestamp, 4), len(data)))
self.log_file_f.write(data)

View File

@ -85,7 +85,11 @@ function openTerminal(options) {
term.write('Connection Reset By Peer');
};
sock.onmessage= function (data) {
term.write(JSON.parse(data.data)['data']);
try {
term.write(data)
} catch (e) {
term.write(JSON.parse(data.data)['data'])
}
};
sock.onerror= function () {
term.write('Connection Reset By Peer');