Skip to content

Commit 2b11043

Browse files
authored
upgrade xterm.js to v6.0.0 (#3095)
removes lots of special case patches for IME and scrolling that were put in to patch over 5.5.0 issues
1 parent 4a28c4b commit 2b11043

7 files changed

Lines changed: 145 additions & 305 deletions

File tree

frontend/app/view/term/term-model.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ export class TermViewModel implements ViewModel {
517517
});
518518
}
519519

520-
getTermRenderer(): "webgl" | "canvas" {
521-
return this.termRef.current?.getTermRenderer() ?? "canvas";
520+
getTermRenderer(): "webgl" | "dom" {
521+
return this.termRef.current?.getTermRenderer() ?? "dom";
522522
}
523523

524524
isWebGlEnabled(): boolean {
@@ -529,7 +529,7 @@ export class TermViewModel implements ViewModel {
529529
if (!this.termRef.current) {
530530
return;
531531
}
532-
const renderer = this.termRef.current.getTermRenderer() === "webgl" ? "canvas" : "webgl";
532+
const renderer = this.termRef.current.getTermRenderer() === "webgl" ? "dom" : "webgl";
533533
this.termRef.current.setTermRenderer(renderer);
534534
}
535535

@@ -698,14 +698,6 @@ export class TermViewModel implements ViewModel {
698698
return true;
699699
}
700700

701-
// Handle Escape key during IME composition
702-
if (keyutil.checkKeyPressed(waveEvent, "Escape")) {
703-
if (this.termRef.current?.isComposing) {
704-
// Reset composition state when Escape is pressed during composition
705-
this.termRef.current.resetCompositionState();
706-
}
707-
}
708-
709701
if (this.keyDownHandler(waveEvent)) {
710702
event.preventDefault();
711703
event.stopPropagation();

frontend/app/view/term/term.scss

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -128,35 +128,12 @@
128128
.terminal {
129129
width: 100%;
130130

131-
.xterm-viewport {
132-
&::-webkit-scrollbar {
133-
width: 6px; /* this needs to match fitAddon.scrollbarWidth in termwrap.ts */
134-
height: 6px;
135-
}
136-
137-
&::-webkit-scrollbar-track {
138-
background-color: var(--scrollbar-background-color);
139-
}
140-
141-
&::-webkit-scrollbar-thumb {
142-
background-color: transparent;
143-
border-radius: 4px;
144-
margin: 0 1px 0 1px;
145-
146-
&:hover {
147-
background-color: var(--scrollbar-thumb-hover-color) !important;
148-
}
149-
150-
&:active {
151-
background-color: var(--scrollbar-thumb-active-color) !important;
152-
}
153-
}
131+
.xterm-decoration-overview-ruler {
132+
display: none !important;
154133
}
155134

156-
&:hover {
157-
.xterm-viewport::-webkit-scrollbar-thumb {
158-
background-color: var(--scrollbar-thumb-color);
159-
}
135+
.xterm-viewport {
136+
background-color: transparent;
160137
}
161138
}
162139
}

frontend/app/view/term/term.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ const TerminalView = ({ blockId, model }: ViewComponentProps<TermViewModel>) =>
300300
macOptionIsMeta: termMacOptionIsMeta,
301301
cursorStyle: termCursorStyle,
302302
cursorBlink: termCursorBlink,
303+
overviewRuler: { width: 6 },
303304
},
304305
{
305306
keydownHandler: model.handleTerminalKeydown.bind(model),
@@ -312,9 +313,6 @@ const TerminalView = ({ blockId, model }: ViewComponentProps<TermViewModel>) =>
312313
model.termRef.current = termWrap;
313314
setTermWrapInst(termWrap);
314315
const rszObs = new ResizeObserver(() => {
315-
if (termWrap.cachedAtBottomForResize == null) {
316-
termWrap.cachedAtBottomForResize = termWrap.wasRecentlyAtBottom();
317-
}
318316
termWrap.handleResize_debounced();
319317
});
320318
rszObs.observe(connectElemRef.current);

0 commit comments

Comments
 (0)