Skip to content

Commit

Permalink
Fix xterm in shared terminals
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-kim committed Nov 24, 2022
1 parent ed3fb20 commit 4e24783
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 7 additions & 1 deletion views/sharing-mobile.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,13 @@
return obj;
}
function tunnelUpdate(data) { if (typeof data == 'string') { xterm.writeUtf8(data); } else { xterm.writeUtf8(new Uint8Array(data)); } }
function tunnelUpdate(data) {
if (xterm.writeUtf8) {
if (typeof data == 'string') { xterm.writeUtf8(data); } else { xterm.writeUtf8(new Uint8Array(data)); }
} else {
if (typeof data == 'string') { xterm.write(data); } else { xterm.write(new Uint8Array(data)); }
}
}
function sshTunnelUpdate(data) {
if (typeof data == 'string') {
Expand Down
12 changes: 9 additions & 3 deletions views/sharing.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
}
function deskAdjust() {
if ((xxcurrentView == 12) && (terminal != null) && (xtermfit != null)) { xtermfit.fit(); } // Terminal
if ((xxcurrentView == 12) && (terminal != null) && (xtermfit != null)) { xtermfit.fit(); } // Terminal
QS('fileArea4')['height'] = 'calc(100vh - ' + (90 + Q('fileArea2').clientHeight) + 'px)'; // Files
var parentH = Q('DeskParent').clientHeight, parentW = Q('DeskParent').clientWidth;
var deskH = Q('Desk').height, deskW = Q('Desk').width;
Expand Down Expand Up @@ -1405,7 +1405,13 @@
return obj;
}
function tunnelUpdate(data) { if (typeof data == 'string') { xterm.writeUtf8(data); } else { xterm.writeUtf8(new Uint8Array(data)); } }
function tunnelUpdate(data) {
if (xterm.writeUtf8) {
if (typeof data == 'string') { xterm.writeUtf8(data); } else { xterm.writeUtf8(new Uint8Array(data)); }
} else {
if (typeof data == 'string') { xterm.write(data); } else { xterm.write(new Uint8Array(data)); }
}
}
// Send the new terminal size to the agent
function xTermSendResize() {
Expand Down Expand Up @@ -1567,7 +1573,7 @@
//
// Files
//
//
function setupFiles() {
// Setup the files tab
Expand Down

0 comments on commit 4e24783

Please sign in to comment.