Removed uneeded terminal (for now)
mellobacon committed
Nov 24, 2022 at 15:08 UTC
c9abcc06480ab38303c28b4b347e2b8afbd6e3d7
1 file changed
-202
src/components/Terminal/Terminal.svelte
deleted
-202
@@ -1,202 +0,0 @@
1
-<script>
2
- import { onMount } from "svelte";
3
- import xterm from "xterm";
4
- import FitAddon from "xterm-addon-fit";
5
- import ResizeObserver from "svelte-resize-observer";
6
-
7
- let terminalElement;
8
- let termFit;
9
- let terminalController;
10
-
11
- function initializeXterm() {
12
- terminalController = new xterm.Terminal({
13
- fontSize: 12,
14
- });
15
- termFit = new FitAddon.FitAddon();
16
- terminalController.loadAddon(termFit);
17
- terminalController.open(terminalElement);
18
- termFit.fit();
19
- terminalController.write("\x1b[32mHello\x1b[m\r\n");
20
- }
21
-
22
- onMount(async () => {
23
- initializeXterm();
24
- });
25
-
26
- function handleResize() {
27
- if (termFit) {
28
- termFit.fit();
29
- }
30
- }
31
-</script>
32
-
33
-<div id="terminal" bind:this={terminalElement} />
34
-
35
-<div class="observer">
36
- <ResizeObserver on:resize={handleResize} />
37
-</div>
38
-
39
-<style>
40
- .observer {
41
- position: absolute;
42
- top: 0;
43
- left: 0;
44
- right: 0;
45
- bottom: 0;
46
- }
47
-
48
- /* Xterm.css */
49
- :global(.xterm) {
50
- cursor: text;
51
- position: relative;
52
- user-select: none;
53
- -ms-user-select: none;
54
- -webkit-user-select: none;
55
- }
56
-
57
- :global(.xterm.focus),
58
- :global(.xterm:focus) {
59
- outline: none;
60
- }
61
-
62
- :global(.xterm .xterm-helpers) {
63
- position: absolute;
64
- top: 0;
65
- /**
66
- * The z-index of the helpers must be higher than the canvases in order for
67
- * IMEs to appear on top.
68
- */
69
- z-index: 5;
70
- }
71
-
72
- :global(.xterm .xterm-helper-textarea) {
73
- padding: 0;
74
- border: 0;
75
- margin: 0;
76
- /* Move textarea out of the screen to the far left, so that the cursor is not visible */
77
- position: absolute;
78
- opacity: 0;
79
- left: -9999em;
80
- top: 0;
81
- width: 0;
82
- height: 0;
83
- z-index: -5;
84
- /** Prevent wrapping so the IME appears against the textarea at the correct position */
85
- white-space: nowrap;
86
- overflow: hidden;
87
- resize: none;
88
- }
89
-
90
- :global(.xterm .composition-view) {
91
- /* TODO: Composition position got messed up somewhere */
92
- background: #000;
93
- color: #fff;
94
- display: none;
95
- position: absolute;
96
- white-space: nowrap;
97
- z-index: 1;
98
- }
99
-
100
- :global(.xterm .composition-view.active) {
101
- display: block;
102
- }
103
-
104
- :global(.xterm .xterm-viewport) {
105
- /* On OS X this is required in order for the scroll bar to appear fully opaque */
106
- background-color: #000;
107
- overflow-y: scroll;
108
- cursor: default;
109
- position: absolute;
110
- right: 0;
111
- left: 0;
112
- top: 0;
113
- bottom: 0;
114
- }
115
-
116
- :global(.xterm .xterm-screen) {
117
- position: relative;
118
- }
119
-
120
- :global(.xterm .xterm-screen canvas) {
121
- position: absolute;
122
- left: 0;
123
- top: 0;
124
- }
125
-
126
- :global(.xterm .xterm-scroll-area) {
127
- visibility: hidden;
128
- }
129
-
130
- :global(.xterm-char-measure-element) {
131
- display: inline-block;
132
- visibility: hidden;
133
- position: absolute;
134
- top: 0;
135
- left: -9999em;
136
- line-height: normal;
137
- }
138
-
139
- :global(.xterm.enable-mouse-events) {
140
- /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
141
- cursor: default;
142
- }
143
-
144
- :global(.xterm.xterm-cursor-pointer),
145
- :global(.xterm .xterm-cursor-pointer) {
146
- cursor: pointer;
147
- }
148
-
149
- :global(.xterm.column-select.focus) {
150
- /* Column selection mode */
151
- cursor: crosshair;
152
- }
153
-
154
- :global(.xterm .xterm-accessibility),
155
- :global(.xterm .xterm-message) {
156
- position: absolute;
157
- left: 0;
158
- top: 0;
159
- bottom: 0;
160
- right: 0;
161
- z-index: 10;
162
- color: transparent;
163
- }
164
-
165
- :global(.xterm .live-region) {
166
- position: absolute;
167
- left: -9999px;
168
- width: 1px;
169
- height: 1px;
170
- overflow: hidden;
171
- }
172
-
173
- :global(.xterm-dim) {
174
- opacity: 0.5;
175
- }
176
-
177
- :global(.xterm-underline) {
178
- text-decoration: underline;
179
- }
180
-
181
- :global(.xterm-strikethrough) {
182
- text-decoration: line-through;
183
- }
184
-
185
- :global(.xterm-screen .xterm-decoration-container .xterm-decoration) {
186
- z-index: 6;
187
- position: absolute;
188
- }
189
-
190
- :global(.xterm-decoration-overview-ruler) {
191
- z-index: 7;
192
- position: absolute;
193
- top: 0;
194
- right: 0;
195
- pointer-events: none;
196
- }
197
-
198
- :global(.xterm-decoration-top) {
199
- z-index: 2;
200
- position: relative;
201
- }
202
-</style>