Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Update xterm.js to v5.3.0 and enable Smooth Scrolling #4257

Merged
merged 2 commits into from
Feb 25, 2024
Merged
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
20 changes: 10 additions & 10 deletions server/controllers/templates/web_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ var ProjectJobsTemplate = template.Must(template.New("blank.html.tmpl").Parse(`
<title>atlantis</title>
<meta name="description" content>
<meta name="author" content>
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/xterm.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/xterm-5.3.0.css">
nitrocode marked this conversation as resolved.
Show resolved Hide resolved
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/normalize.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/skeleton.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/custom.css">
Expand Down Expand Up @@ -487,17 +487,17 @@ var ProjectJobsTemplate = template.Must(template.New("blank.html.tmpl").Parse(`
</footer>

<script src="{{ .CleanedBasePath }}/static/js/jquery-3.5.1.min.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-4.9.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-attach-0.6.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-fit-0.4.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-search-0.7.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-5.3.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-attach-0.9.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-fit-0.8.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-search-0.13.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-search-bar.js"></script>

<script>
function updateTerminalStatus(msg) {
document.getElementsByTagName("footer")[0].innerText = msg;
}
var term = new Terminal({scrollback: 15000});
var term = new Terminal({scrollback: 15000, smoothScrollDuration:125 });
var socket = new WebSocket(
(document.location.protocol === "http:" ? "ws://" : "wss://") +
document.location.host +
Expand Down Expand Up @@ -545,7 +545,7 @@ var ProjectJobsErrorTemplate = template.Must(template.New("blank.html.tmpl").Par
<title>atlantis</title>
<meta name="description" content>
<meta name="author" content>
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/xterm.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/xterm-5.3.0.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/normalize.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/skeleton.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/custom.css">
Expand Down Expand Up @@ -575,9 +575,9 @@ var ProjectJobsErrorTemplate = template.Must(template.New("blank.html.tmpl").Par
</footer>

<script src="{{ .CleanedBasePath }}/static/js/jquery-3.5.1.min.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-4.9.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-attach-0.6.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-fit-0.4.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-5.3.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-attach-0.9.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-fit-0.8.0.js"></script>

<script>
var term = new Terminal();
Expand Down
70 changes: 54 additions & 16 deletions server/static/css/xterm.css → server/static/css/xterm-5.3.0.css
Original file line number Diff line number Diff line change
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 @@ -55,21 +55,21 @@
* The z-index of the helpers must be higher than the canvases in order for
* IMEs to appear on top.
*/
z-index: 10;
z-index: 5;
}

.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;
top: 0;
width: 0;
height: 0;
z-index: -10;
z-index: -5;
/** Prevent wrapping so the IME appears against the textarea at the correct position */
white-space: nowrap;
overflow: hidden;
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 All @@ -150,8 +147,9 @@
top: 0;
bottom: 0;
right: 0;
z-index: 100;
z-index: 10;
color: transparent;
pointer-events: none;
}

.xterm .live-region {
Expand All @@ -163,9 +161,49 @@
}

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

.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-overline {
text-decoration: overline;
}

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

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

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

.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
z-index: 7;
}

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

.xterm-decoration-top {
z-index: 2;
position: relative;
}
24 changes: 0 additions & 24 deletions server/static/js/xterm-4.9.0.js

This file was deleted.

2 changes: 2 additions & 0 deletions server/static/js/xterm-5.3.0.js

Large diffs are not rendered by default.

24 changes: 0 additions & 24 deletions server/static/js/xterm-addon-attach-0.6.0.js

This file was deleted.

2 changes: 2 additions & 0 deletions server/static/js/xterm-addon-attach-0.9.0.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions server/static/js/xterm-addon-fit-0.4.0.js

This file was deleted.

2 changes: 2 additions & 0 deletions server/static/js/xterm-addon-fit-0.8.0.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading