Skip to content

Commit

Permalink
Updated xterm.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Ylianst committed Oct 23, 2022
1 parent 90e271d commit d99755f
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 20 deletions.
1 change: 0 additions & 1 deletion public/scripts/xterm-min.js

This file was deleted.

2 changes: 1 addition & 1 deletion public/scripts/xterm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/scripts/xterm.js.map

Large diffs are not rendered by default.

45 changes: 33 additions & 12 deletions public/styles/xterm.css
Expand Up @@ -36,7 +36,7 @@
*/

.xterm {
font-feature-settings: "liga" 0;
cursor: text;
position: relative;
user-select: none;
-ms-user-select: none;
Expand All @@ -59,10 +59,10 @@
}

.xterm .xterm-helper-textarea {
/*
* HACK: to fix IE's blinking cursor
* Move textarea out of the screen to the far left, so that the cursor is not visible.
*/
padding: 0;
border: 0;
margin: 0;
/* Move textarea out of the screen to the far left, so that the cursor is not visible */
position: absolute;
opacity: 0;
left: -9999em;
Expand Down Expand Up @@ -125,16 +125,13 @@
line-height: normal;
}

.xterm {
cursor: text;
}

.xterm.enable-mouse-events {
/* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
cursor: default;
}

.xterm.xterm-cursor-pointer {
.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
cursor: pointer;
}

Expand Down Expand Up @@ -166,6 +163,30 @@
opacity: 0.5;
}

.xterm-underline {
text-decoration: underline;
.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }

.xterm-strikethrough {
text-decoration: line-through;
}

.xterm-screen .xterm-decoration-container .xterm-decoration {
z-index: 6;
position: absolute;
}

.xterm-decoration-overview-ruler {
z-index: 7;
position: absolute;
top: 0;
right: 0;
pointer-events: none;
}

.xterm-decoration-top {
z-index: 2;
position: relative;
}
15 changes: 12 additions & 3 deletions views/default-mobile.handlebars
Expand Up @@ -947,7 +947,7 @@
</div>
<div id="termarea3" style="width:100%;height: calc(100% - 60px);" cellpadding=0 cellspacing=0>
<div id="termarea3x" style="width:100%;height:100%">
<div style="width:100%;height:100%" id="termarea3xdiv"></div>
<div style="width:100%;height:100%;text-align:left" id="termarea3xdiv"></div>
</div>
</div>
<div id="termarea4" style="position:relative;height:32px;">
Expand Down Expand Up @@ -4806,7 +4806,16 @@
return obj;
}

function tunnelUpdate(data) { if (typeof data == 'string') { xterm.writeUtf8(data); } else { xterm.writeUtf8(new Uint8Array(data)); } }
function tunnelUpdate(data) {
if (xterm != null) {
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 tunnelUpdate(data) { if (typeof data == 'string') { xterm.writeUtf8(data); } else { xterm.writeUtf8(new Uint8Array(data)); } }

function sshTunnelAuthDialog(j, func) {
var x = '';
Expand Down Expand Up @@ -5021,7 +5030,7 @@
xterm = new Terminal();
xtermfit = new FitAddon.FitAddon();
if (xtermfit) { xterm.loadAddon(xtermfit); }
xterm.setOption('scrollback', 0);
//xterm.setOption('scrollback', 0);
//xterm.setOption('fontSize', 15);
xterm.open(Q('termarea3xdiv'));
xterm.onData(function (data) { if (terminal.urlname == 'sshterminalrelay.ashx') { terminal.socket.send('~' + data); } else { terminal.sendText(data); } })
Expand Down
12 changes: 10 additions & 2 deletions views/default.handlebars
Expand Up @@ -775,7 +775,7 @@
</tr>
<tr>
<td id="termarea3x">
<div id="termarea3xdiv" style="width:100%;height:100%"></div>
<div id="termarea3xdiv" style="width:100%;height:100%;text-align:left"></div>
<pre id="Term"></pre>
</td>
</tr>
Expand Down Expand Up @@ -10130,7 +10130,15 @@
return obj;
}

function tunnelUpdate(data) { if (xterm != null) { if (typeof data == 'string') { xterm.writeUtf8(data); } else { xterm.writeUtf8(new Uint8Array(data)); } } }
function tunnelUpdate(data) {
if (xterm != null) {
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 sshTunnelAuthDialog(j, func) {
var x = '';
Expand Down

0 comments on commit d99755f

Please sign in to comment.