Skip to content

Commit aeb387a

Browse files
committed
Bump xterm version
This seems to resolve a long standing performance issue on mobile during terminal resizing
1 parent 9f3308e commit aeb387a

File tree

5 files changed

+60
-13
lines changed

5 files changed

+60
-13
lines changed

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<script src="serviceWorker.js"></script>
3939
<script src="./xterm/xterm.js"></script>
4040
<script src="./xterm/xterm-addon-fit.js"></script>
41+
<script src="./xterm/xterm-addon-web-links.js"></script>
4142
<script src="network.js"></script>
4243
<script defer data-domain="webvm.io" src="https://plausible.leaningtech.com/js/script.js"></script>
4344
</head>
@@ -228,6 +229,8 @@
228229
var term = new Terminal({cursorBlink:true,convertEol:true, fontFamily:"monospace", fontWeight: 400, fontWeightBold: 700});
229230
var fitAddon = new FitAddon.FitAddon();
230231
term.loadAddon(fitAddon);
232+
var linkAddon = new WebLinksAddon.WebLinksAddon();
233+
term.loadAddon(linkAddon);
231234
term.open(consoleDiv);
232235
term.scrollToTop();
233236

@@ -345,9 +348,6 @@
345348
function initialMessage()
346349
{
347350
printOnTerm.printMessage(printOnTerm.getAsciiText());
348-
term.registerLinkMatcher(/https:\/\/leaningtech.com\/[a-z-]+/, function(mouseEvent, matchedString) {
349-
window.open(matchedString, "_blank")
350-
});
351351
console.log("Welcome. We appreciate curiosity, but be warned that keeping the DevTools open causes significant performance degradation and crashes.");
352352
}
353353
initialMessage();

xterm/xterm-addon-fit.js

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

xterm/xterm-addon-web-links.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

xterm/xterm.css

+51-8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
*/
3737

3838
.xterm {
39+
cursor: text;
3940
position: relative;
4041
user-select: none;
4142
-ms-user-select: none;
@@ -124,10 +125,6 @@
124125
line-height: normal;
125126
}
126127

127-
.xterm {
128-
cursor: text;
129-
}
130-
131128
.xterm.enable-mouse-events {
132129
/* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
133130
cursor: default;
@@ -143,7 +140,7 @@
143140
cursor: crosshair;
144141
}
145142

146-
.xterm .xterm-accessibility,
143+
.xterm .xterm-accessibility:not(.debug),
147144
.xterm .xterm-message {
148145
position: absolute;
149146
left: 0;
@@ -152,6 +149,16 @@
152149
right: 0;
153150
z-index: 10;
154151
color: transparent;
152+
pointer-events: none;
153+
}
154+
155+
.xterm .xterm-accessibility-tree:not(.debug) *::selection {
156+
color: transparent;
157+
}
158+
159+
.xterm .xterm-accessibility-tree {
160+
user-select: text;
161+
white-space: pre;
155162
}
156163

157164
.xterm .live-region {
@@ -163,13 +170,49 @@
163170
}
164171

165172
.xterm-dim {
166-
opacity: 0.5;
173+
/* Dim should not apply to background, so the opacity of the foreground color is applied
174+
* explicitly in the generated class and reset to 1 here */
175+
opacity: 1 !important;
167176
}
168177

169-
.xterm-underline {
170-
text-decoration: underline;
178+
.xterm-underline-1 { text-decoration: underline; }
179+
.xterm-underline-2 { text-decoration: double underline; }
180+
.xterm-underline-3 { text-decoration: wavy underline; }
181+
.xterm-underline-4 { text-decoration: dotted underline; }
182+
.xterm-underline-5 { text-decoration: dashed underline; }
183+
184+
.xterm-overline {
185+
text-decoration: overline;
171186
}
172187

188+
.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
189+
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
190+
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
191+
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
192+
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
193+
173194
.xterm-strikethrough {
174195
text-decoration: line-through;
175196
}
197+
198+
.xterm-screen .xterm-decoration-container .xterm-decoration {
199+
z-index: 6;
200+
position: absolute;
201+
}
202+
203+
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
204+
z-index: 7;
205+
}
206+
207+
.xterm-decoration-overview-ruler {
208+
z-index: 8;
209+
position: absolute;
210+
top: 0;
211+
right: 0;
212+
pointer-events: none;
213+
}
214+
215+
.xterm-decoration-top {
216+
z-index: 2;
217+
position: relative;
218+
}

xterm/xterm.js

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)