@theia/terminal 1.53.0-next.4 → 1.53.0-next.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/terminal-link-provider.d.ts +1 -1
  3. package/lib/browser/terminal-link-provider.d.ts.map +1 -1
  4. package/lib/browser/terminal-widget-impl.js +4 -4
  5. package/package.json +10 -10
  6. package/src/browser/base/terminal-service.ts +60 -60
  7. package/src/browser/base/terminal-widget.ts +268 -268
  8. package/src/browser/index.ts +17 -17
  9. package/src/browser/search/terminal-search-container.ts +28 -28
  10. package/src/browser/search/terminal-search-widget.tsx +161 -161
  11. package/src/browser/shell-terminal-profile.ts +45 -45
  12. package/src/browser/style/terminal-search.css +99 -99
  13. package/src/browser/style/terminal.css +32 -32
  14. package/src/browser/terminal-contribution.ts +19 -19
  15. package/src/browser/terminal-copy-on-selection-handler.ts +92 -92
  16. package/src/browser/terminal-file-link-provider.ts +289 -289
  17. package/src/browser/terminal-frontend-contribution.ts +1134 -1134
  18. package/src/browser/terminal-frontend-module.ts +138 -138
  19. package/src/browser/terminal-link-helpers.ts +187 -187
  20. package/src/browser/terminal-link-provider.ts +203 -203
  21. package/src/browser/terminal-preferences.ts +428 -428
  22. package/src/browser/terminal-profile-service.ts +180 -180
  23. package/src/browser/terminal-quick-open-service.ts +132 -132
  24. package/src/browser/terminal-theme-service.ts +213 -213
  25. package/src/browser/terminal-url-link-provider.ts +66 -66
  26. package/src/browser/terminal-widget-impl.ts +996 -996
  27. package/src/common/base-terminal-protocol.ts +125 -125
  28. package/src/common/shell-terminal-protocol.ts +103 -103
  29. package/src/common/terminal-common-module.ts +30 -30
  30. package/src/common/terminal-protocol.ts +32 -32
  31. package/src/common/terminal-watcher.ts +69 -69
  32. package/src/node/base-terminal-server.ts +173 -173
  33. package/src/node/buffering-stream.spec.ts +46 -46
  34. package/src/node/buffering-stream.ts +95 -95
  35. package/src/node/index.ts +17 -17
  36. package/src/node/shell-process.ts +102 -102
  37. package/src/node/shell-terminal-server.spec.ts +40 -40
  38. package/src/node/shell-terminal-server.ts +223 -223
  39. package/src/node/terminal-backend-contribution.slow-spec.ts +63 -63
  40. package/src/node/terminal-backend-contribution.ts +60 -60
  41. package/src/node/terminal-backend-module.ts +82 -82
  42. package/src/node/terminal-server.spec.ts +47 -47
  43. package/src/node/terminal-server.ts +52 -52
  44. package/src/node/test/terminal-test-container.ts +39 -39
  45. package/src/package.spec.ts +28 -28
@@ -1,32 +1,32 @@
1
- /********************************************************************************
2
- * Copyright (C) 2017 TypeFox and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
-
17
- .terminal-container {
18
- width: 100%;
19
- height: 100%;
20
- padding: var(--theia-code-padding);
21
- background: var(--theia-terminal-background);
22
- }
23
-
24
- .xterm .xterm-screen canvas {
25
- /* fix random 1px white border on terminal in Firefox. See https://github.com/eclipse-theia/theia/issues/4665 */
26
- border: 1px solid var(--theia-terminal-background);
27
- }
28
-
29
- .terminal-container .xterm .xterm-helper-textarea {
30
- /* fix secondary cursor-like issue. See https://github.com/eclipse-theia/theia/issues/8158 */
31
- opacity: 0 !important;
32
- }
1
+ /********************************************************************************
2
+ * Copyright (C) 2017 TypeFox and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ .terminal-container {
18
+ width: 100%;
19
+ height: 100%;
20
+ padding: var(--theia-code-padding);
21
+ background: var(--theia-terminal-background);
22
+ }
23
+
24
+ .xterm .xterm-screen canvas {
25
+ /* fix random 1px white border on terminal in Firefox. See https://github.com/eclipse-theia/theia/issues/4665 */
26
+ border: 1px solid var(--theia-terminal-background);
27
+ }
28
+
29
+ .terminal-container .xterm .xterm-helper-textarea {
30
+ /* fix secondary cursor-like issue. See https://github.com/eclipse-theia/theia/issues/8158 */
31
+ opacity: 0 !important;
32
+ }
@@ -1,19 +1,19 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { TerminalContribution } from './terminal-widget-impl';
18
- /** @deprecated @since 1.28.0 import from `terminal-widget-impl` instead. */
19
- export { TerminalContribution };
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { TerminalContribution } from './terminal-widget-impl';
18
+ /** @deprecated @since 1.28.0 import from `terminal-widget-impl` instead. */
19
+ export { TerminalContribution };
@@ -1,92 +1,92 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 Red Hat, Inc. and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { injectable, postConstruct } from '@theia/core/shared/inversify';
18
- import { isFirefox } from '@theia/core/lib/browser';
19
-
20
- @injectable()
21
- export class TerminalCopyOnSelectionHandler {
22
-
23
- private textToCopy: string;
24
- private interceptCopy: boolean;
25
-
26
- private copyListener = (ev: ClipboardEvent) => {
27
- if (this.interceptCopy && ev.clipboardData) {
28
- ev.clipboardData.setData('text/plain', this.textToCopy);
29
- ev.preventDefault();
30
- }
31
- };
32
-
33
- @postConstruct()
34
- protected init(): void {
35
- document.addEventListener('copy', this.copyListener);
36
- }
37
-
38
- private async clipBoardCopyIsGranted(): Promise<boolean> {
39
- // Unfortunately Firefox doesn't support permission check `clipboard-write`, so let try to copy anyway,
40
- if (isFirefox) {
41
- return true;
42
- }
43
- try {
44
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
- const permissions = (navigator as any).permissions;
46
- const { state } = await permissions.query({ name: 'clipboard-write' });
47
- if (state === 'granted') {
48
- return true;
49
- }
50
- } catch (e) { }
51
-
52
- return false;
53
- }
54
-
55
- private executeCommandCopy(): void {
56
- try {
57
- this.interceptCopy = true;
58
- document.execCommand('copy');
59
- this.interceptCopy = false;
60
- } catch (e) {
61
- // do nothing
62
- }
63
- }
64
-
65
- private async writeToClipBoard(): Promise<void> {
66
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
- const clipboard = (navigator as any).clipboard;
68
-
69
- if (!clipboard) {
70
- this.executeCommandCopy();
71
- return;
72
- }
73
-
74
- try {
75
- await clipboard.writeText(this.textToCopy);
76
- } catch (e) {
77
- this.executeCommandCopy();
78
- }
79
- }
80
-
81
- async copy(text: string): Promise<void> {
82
- this.textToCopy = text;
83
-
84
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
85
- const permissions = (navigator as any).permissions;
86
- if (permissions && permissions.query && await this.clipBoardCopyIsGranted()) {
87
- await this.writeToClipBoard();
88
- } else {
89
- this.executeCommandCopy();
90
- }
91
- }
92
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 Red Hat, Inc. and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { injectable, postConstruct } from '@theia/core/shared/inversify';
18
+ import { isFirefox } from '@theia/core/lib/browser';
19
+
20
+ @injectable()
21
+ export class TerminalCopyOnSelectionHandler {
22
+
23
+ private textToCopy: string;
24
+ private interceptCopy: boolean;
25
+
26
+ private copyListener = (ev: ClipboardEvent) => {
27
+ if (this.interceptCopy && ev.clipboardData) {
28
+ ev.clipboardData.setData('text/plain', this.textToCopy);
29
+ ev.preventDefault();
30
+ }
31
+ };
32
+
33
+ @postConstruct()
34
+ protected init(): void {
35
+ document.addEventListener('copy', this.copyListener);
36
+ }
37
+
38
+ private async clipBoardCopyIsGranted(): Promise<boolean> {
39
+ // Unfortunately Firefox doesn't support permission check `clipboard-write`, so let try to copy anyway,
40
+ if (isFirefox) {
41
+ return true;
42
+ }
43
+ try {
44
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
+ const permissions = (navigator as any).permissions;
46
+ const { state } = await permissions.query({ name: 'clipboard-write' });
47
+ if (state === 'granted') {
48
+ return true;
49
+ }
50
+ } catch (e) { }
51
+
52
+ return false;
53
+ }
54
+
55
+ private executeCommandCopy(): void {
56
+ try {
57
+ this.interceptCopy = true;
58
+ document.execCommand('copy');
59
+ this.interceptCopy = false;
60
+ } catch (e) {
61
+ // do nothing
62
+ }
63
+ }
64
+
65
+ private async writeToClipBoard(): Promise<void> {
66
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
+ const clipboard = (navigator as any).clipboard;
68
+
69
+ if (!clipboard) {
70
+ this.executeCommandCopy();
71
+ return;
72
+ }
73
+
74
+ try {
75
+ await clipboard.writeText(this.textToCopy);
76
+ } catch (e) {
77
+ this.executeCommandCopy();
78
+ }
79
+ }
80
+
81
+ async copy(text: string): Promise<void> {
82
+ this.textToCopy = text;
83
+
84
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
85
+ const permissions = (navigator as any).permissions;
86
+ if (permissions && permissions.query && await this.clipBoardCopyIsGranted()) {
87
+ await this.writeToClipBoard();
88
+ } else {
89
+ this.executeCommandCopy();
90
+ }
91
+ }
92
+ }