mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Removing JS adding #terminal-init so that unit tests don't have global state (#4627)
This commit is contained in:
parent
02056a6090
commit
2a31c5a0d5
@ -91,6 +91,15 @@ html, body {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#terminal-init {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
|
|||||||
@ -34,17 +34,9 @@ import { clipboard } from "electron";
|
|||||||
import logger from "../../../common/logger";
|
import logger from "../../../common/logger";
|
||||||
|
|
||||||
export class Terminal {
|
export class Terminal {
|
||||||
public static readonly spawningPool = (() => {
|
public static get spawningPool() {
|
||||||
// terminal element must be in DOM before attaching via xterm.open(elem)
|
return document.getElementById("terminal-init");
|
||||||
// https://xtermjs.org/docs/api/terminal/classes/terminal/#open
|
}
|
||||||
const pool = document.createElement("div");
|
|
||||||
|
|
||||||
pool.className = "terminal-init";
|
|
||||||
pool.style.cssText = "position: absolute; top: 0; left: 0; height: 0; visibility: hidden; overflow: hidden";
|
|
||||||
document.body.appendChild(pool);
|
|
||||||
|
|
||||||
return pool;
|
|
||||||
})();
|
|
||||||
|
|
||||||
static async preloadFonts() {
|
static async preloadFonts() {
|
||||||
const fontPath = require("../fonts/roboto-mono-nerd.ttf").default; // eslint-disable-line @typescript-eslint/no-var-requires
|
const fontPath = require("../fonts/roboto-mono-nerd.ttf").default; // eslint-disable-line @typescript-eslint/no-var-requires
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
<div id="terminal-init"></div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user