Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions notebook_xterm/terminalclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ TerminalClient.prototype.receive_data_callback = function(data) {
}

try {
var decoded = atob(data.content.text);
var decoded = decodeURIComponent(escape(window.atob(data.content.text)));
this.term.write(decoded);
}
catch(e) {
Expand All @@ -147,7 +147,7 @@ TerminalClient.prototype.handle_transmit = function(data) {
this.curPollInterval = MIN_POLL_INTERVAL;

// transmit data to the server, but b64 encode it
this.server_exec(PY_TERMINAL_SERVER + '.transmit(b"' + btoa(data) + '")');
this.server_exec(PY_TERMINAL_SERVER + '.transmit(b"' + btoa(unescape(encodeURIComponent(data))) + '")');
}

TerminalClient.prototype.handle_resize = function() {
Expand Down
2 changes: 1 addition & 1 deletion notebook_xterm/terminalserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def receive(self):
data = os.read(self.fd, 8192)
except OSError:
data = b''
sys.stdout.write(base64.b64encode(data))
sys.stdout.write(base64.b64encode(data).decode('utf-8'))

def update_window_size(self, rows, cols):
#notify that the pty size should change to match xterm.js
Expand Down