We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
thanks,aluzzardi. sorry everyboy for my english.
diff --git a/wssh/server.py b/wssh/server.py index 17a4965..b334477 100644 --- a/wssh/server.py +++ b/wssh/server.py @@ -118,19 +118,26 @@ class WSSHBridge(object): data['resize'].get('width', 80), data['resize'].get('height', 24)) if 'data' in data: - channel.send(data['data']) + channel.send(data['data'].encode('utf-8')) finally: self.close() def _forward_outbound(self, channel): """ Forward outbound traffic (ssh -> websockets) """ try: + data = '' while True: wait_read(channel.fileno()) - data = channel.recv(1024) - if not len(data): + recv = channel.recv(1024) + if not len(recv): return - self._websocket.send(json.dumps({'data': data})) + + data += recv + try: + self._websocket.send(json.dumps({'data':data})) + data = '' + except UnicodeDecodeError: + pass finally: self.close() diff --git a/wssh/static/term.js b/wssh/static/term.js index 9489334..20883bf 100644 --- a/wssh/static/term.js +++ b/wssh/static/term.js @@ -129,9 +129,10 @@ function Terminal(cols, rows, handler) { this.cols = cols || Terminal.geometry[0]; this.rows = rows || Terminal.geometry[1]; - - if (handler) { - this.on('data', handler); + this.handler = handler; + + if (this.handler) { + this.on('data', this.handler); } this.ybase = 0; @@ -2432,7 +2433,7 @@ Terminal.prototype.reverseIndex = function() { // ESC c Full Reset (RIS). Terminal.prototype.reset = function() { - Terminal.call(this, this.cols, this.rows); + Terminal.call(this, this.cols, this.rows, this.handler); this.refresh(0, this.rows - 1); };
The text was updated successfully, but these errors were encountered:
I try this patch, but when I login, I can't find the term anymore
Sorry, something went wrong.
Apply patch from aluzzardi#15
f5f9c9d
4e1bd8e
No branches or pull requests
thanks,aluzzardi.
sorry everyboy for my english.
The text was updated successfully, but these errors were encountered: