@theia/terminal 1.45.0 → 1.46.0-next.72
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.
- package/README.md +30 -30
- package/lib/browser/base/terminal-service.d.ts +34 -34
- package/lib/browser/base/terminal-service.js +7 -7
- package/lib/browser/base/terminal-widget.d.ts +192 -192
- package/lib/browser/base/terminal-widget.js +34 -34
- package/lib/browser/index.d.ts +1 -1
- package/lib/browser/index.js +28 -28
- package/lib/browser/search/terminal-search-container.d.ts +3 -3
- package/lib/browser/search/terminal-search-container.js +28 -28
- package/lib/browser/search/terminal-search-widget.d.ts +30 -30
- package/lib/browser/search/terminal-search-widget.js +147 -147
- package/lib/browser/shell-terminal-profile.d.ts +20 -20
- package/lib/browser/shell-terminal-profile.js +42 -42
- package/lib/browser/terminal-contribution.d.ts +3 -3
- package/lib/browser/terminal-contribution.js +20 -20
- package/lib/browser/terminal-copy-on-selection-handler.d.ts +10 -10
- package/lib/browser/terminal-copy-on-selection-handler.js +103 -103
- package/lib/browser/terminal-file-link-provider.d.ts +24 -24
- package/lib/browser/terminal-file-link-provider.js +200 -200
- package/lib/browser/terminal-frontend-contribution.d.ts +115 -115
- package/lib/browser/terminal-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/terminal-frontend-contribution.js +1078 -1056
- package/lib/browser/terminal-frontend-contribution.js.map +1 -1
- package/lib/browser/terminal-frontend-module.d.ts +5 -5
- package/lib/browser/terminal-frontend-module.js +117 -117
- package/lib/browser/terminal-link-helpers.d.ts +27 -27
- package/lib/browser/terminal-link-helpers.js +155 -155
- package/lib/browser/terminal-link-provider.d.ts +51 -51
- package/lib/browser/terminal-link-provider.js +197 -197
- package/lib/browser/terminal-preferences.d.ts +61 -61
- package/lib/browser/terminal-preferences.d.ts.map +1 -1
- package/lib/browser/terminal-preferences.js +357 -356
- package/lib/browser/terminal-preferences.js.map +1 -1
- package/lib/browser/terminal-profile-service.d.ts +58 -58
- package/lib/browser/terminal-profile-service.js +158 -158
- package/lib/browser/terminal-quick-open-service.d.ts +36 -36
- package/lib/browser/terminal-quick-open-service.js +137 -137
- package/lib/browser/terminal-theme-service.d.ts +21 -21
- package/lib/browser/terminal-theme-service.d.ts.map +1 -1
- package/lib/browser/terminal-theme-service.js +222 -218
- package/lib/browser/terminal-theme-service.js.map +1 -1
- package/lib/browser/terminal-url-link-provider.d.ts +11 -11
- package/lib/browser/terminal-url-link-provider.js +76 -76
- package/lib/browser/terminal-widget-impl.d.ts +180 -187
- package/lib/browser/terminal-widget-impl.d.ts.map +1 -1
- package/lib/browser/terminal-widget-impl.js +857 -867
- package/lib/browser/terminal-widget-impl.js.map +1 -1
- package/lib/common/base-terminal-protocol.d.ts +55 -55
- package/lib/common/base-terminal-protocol.js +84 -84
- package/lib/common/shell-terminal-protocol.d.ts +66 -66
- package/lib/common/shell-terminal-protocol.js +35 -35
- package/lib/common/terminal-common-module.d.ts +7 -7
- package/lib/common/terminal-common-module.js +31 -31
- package/lib/common/terminal-protocol.d.ts +12 -12
- package/lib/common/terminal-protocol.js +21 -21
- package/lib/common/terminal-watcher.d.ts +13 -13
- package/lib/common/terminal-watcher.js +70 -70
- package/lib/node/base-terminal-server.d.ts +24 -24
- package/lib/node/base-terminal-server.js +168 -168
- package/lib/node/buffering-stream.d.ts +39 -39
- package/lib/node/buffering-stream.js +75 -75
- package/lib/node/buffering-stream.spec.d.ts +1 -1
- package/lib/node/buffering-stream.spec.js +43 -43
- package/lib/node/index.d.ts +1 -1
- package/lib/node/index.js +28 -28
- package/lib/node/shell-process.d.ts +27 -27
- package/lib/node/shell-process.js +107 -107
- package/lib/node/shell-process.js.map +1 -1
- package/lib/node/shell-terminal-server.d.ts +30 -30
- package/lib/node/shell-terminal-server.js +212 -212
- package/lib/node/shell-terminal-server.spec.d.ts +1 -1
- package/lib/node/shell-terminal-server.spec.js +35 -35
- package/lib/node/terminal-backend-contribution.d.ts +9 -9
- package/lib/node/terminal-backend-contribution.js +75 -75
- package/lib/node/terminal-backend-contribution.slow-spec.d.ts +1 -1
- package/lib/node/terminal-backend-contribution.slow-spec.js +54 -54
- package/lib/node/terminal-backend-module.d.ts +11 -11
- package/lib/node/terminal-backend-module.js +69 -69
- package/lib/node/terminal-server.d.ts +9 -9
- package/lib/node/terminal-server.js +64 -64
- package/lib/node/terminal-server.spec.d.ts +1 -1
- package/lib/node/terminal-server.spec.js +41 -41
- package/lib/node/test/terminal-test-container.d.ts +2 -2
- package/lib/node/test/terminal-test-container.js +40 -40
- package/lib/package.spec.js +25 -25
- package/package.json +12 -12
- package/src/browser/base/terminal-service.ts +60 -60
- package/src/browser/base/terminal-widget.ts +254 -254
- package/src/browser/index.ts +17 -17
- package/src/browser/search/terminal-search-container.ts +28 -28
- package/src/browser/search/terminal-search-widget.tsx +161 -161
- package/src/browser/shell-terminal-profile.ts +45 -45
- package/src/browser/style/terminal-search.css +99 -99
- package/src/browser/style/terminal.css +32 -32
- package/src/browser/terminal-contribution.ts +19 -19
- package/src/browser/terminal-copy-on-selection-handler.ts +92 -92
- package/src/browser/terminal-file-link-provider.ts +200 -200
- package/src/browser/terminal-frontend-contribution.ts +1120 -1098
- package/src/browser/terminal-frontend-module.ts +136 -136
- package/src/browser/terminal-link-helpers.ts +187 -187
- package/src/browser/terminal-link-provider.ts +203 -203
- package/src/browser/terminal-preferences.ts +428 -427
- package/src/browser/terminal-profile-service.ts +180 -180
- package/src/browser/terminal-quick-open-service.ts +132 -132
- package/src/browser/terminal-theme-service.ts +213 -209
- package/src/browser/terminal-url-link-provider.ts +66 -66
- package/src/browser/terminal-widget-impl.ts +939 -936
- package/src/common/base-terminal-protocol.ts +125 -125
- package/src/common/shell-terminal-protocol.ts +103 -103
- package/src/common/terminal-common-module.ts +30 -30
- package/src/common/terminal-protocol.ts +32 -32
- package/src/common/terminal-watcher.ts +69 -69
- package/src/node/base-terminal-server.ts +173 -173
- package/src/node/buffering-stream.spec.ts +46 -46
- package/src/node/buffering-stream.ts +95 -95
- package/src/node/index.ts +17 -17
- package/src/node/shell-process.ts +101 -101
- package/src/node/shell-terminal-server.spec.ts +40 -40
- package/src/node/shell-terminal-server.ts +221 -221
- package/src/node/terminal-backend-contribution.slow-spec.ts +63 -63
- package/src/node/terminal-backend-contribution.ts +60 -60
- package/src/node/terminal-backend-module.ts +82 -82
- package/src/node/terminal-server.spec.ts +47 -47
- package/src/node/terminal-server.ts +52 -52
- package/src/node/test/terminal-test-container.ts +39 -39
- package/src/package.spec.ts +28 -28
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
<div align='center'>
|
|
2
|
-
|
|
3
|
-
<br />
|
|
4
|
-
|
|
5
|
-
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
-
|
|
7
|
-
<h2>ECLIPSE THEIA - TERMINAL EXTENSION</h2>
|
|
8
|
-
|
|
9
|
-
<hr />
|
|
10
|
-
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
## Description
|
|
14
|
-
|
|
15
|
-
The `@theia/terminal` extension contributes the ability to spawn integrated terminals in the application which can be used in a variety of different scenarios.
|
|
16
|
-
|
|
17
|
-
## Additional Information
|
|
18
|
-
|
|
19
|
-
- [API documentation for `@theia/terminal`](https://eclipse-theia.github.io/theia/docs/next/modules/terminal.html)
|
|
20
|
-
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
21
|
-
- [Theia - Website](https://theia-ide.org/)
|
|
22
|
-
|
|
23
|
-
## License
|
|
24
|
-
|
|
25
|
-
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
26
|
-
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
27
|
-
|
|
28
|
-
## Trademark
|
|
29
|
-
"Theia" is a trademark of the Eclipse Foundation
|
|
30
|
-
https://www.eclipse.org/theia
|
|
1
|
+
<div align='center'>
|
|
2
|
+
|
|
3
|
+
<br />
|
|
4
|
+
|
|
5
|
+
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
+
|
|
7
|
+
<h2>ECLIPSE THEIA - TERMINAL EXTENSION</h2>
|
|
8
|
+
|
|
9
|
+
<hr />
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
The `@theia/terminal` extension contributes the ability to spawn integrated terminals in the application which can be used in a variety of different scenarios.
|
|
16
|
+
|
|
17
|
+
## Additional Information
|
|
18
|
+
|
|
19
|
+
- [API documentation for `@theia/terminal`](https://eclipse-theia.github.io/theia/docs/next/modules/terminal.html)
|
|
20
|
+
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
21
|
+
- [Theia - Website](https://theia-ide.org/)
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
26
|
+
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
27
|
+
|
|
28
|
+
## Trademark
|
|
29
|
+
"Theia" is a trademark of the Eclipse Foundation
|
|
30
|
+
https://www.eclipse.org/theia
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { Event } from '@theia/core/lib/common/event';
|
|
2
|
-
import { WidgetOpenerOptions } from '@theia/core/lib/browser';
|
|
3
|
-
import { TerminalWidgetOptions, TerminalWidget } from './terminal-widget';
|
|
4
|
-
/**
|
|
5
|
-
* Service manipulating terminal widgets.
|
|
6
|
-
*/
|
|
7
|
-
export declare const TerminalService: unique symbol;
|
|
8
|
-
export interface TerminalService {
|
|
9
|
-
/**
|
|
10
|
-
* Create new terminal with predefined options.
|
|
11
|
-
* @param options - terminal options.
|
|
12
|
-
*/
|
|
13
|
-
newTerminal(options: TerminalWidgetOptions): Promise<TerminalWidget>;
|
|
14
|
-
open(terminal: TerminalWidget, options?: WidgetOpenerOptions): void;
|
|
15
|
-
readonly all: TerminalWidget[];
|
|
16
|
-
/**
|
|
17
|
-
* @param id - the widget id (NOT the terminal id!)
|
|
18
|
-
* @return the widget
|
|
19
|
-
*/
|
|
20
|
-
getById(id: string): TerminalWidget | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* @param id - the terminal id (NOT the terminal widget id!)
|
|
23
|
-
* @return the widget
|
|
24
|
-
*/
|
|
25
|
-
getByTerminalId(terminalId: number): TerminalWidget | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Returns detected default shell.
|
|
28
|
-
*/
|
|
29
|
-
getDefaultShell(): Promise<string>;
|
|
30
|
-
readonly onDidCreateTerminal: Event<TerminalWidget>;
|
|
31
|
-
readonly currentTerminal: TerminalWidget | undefined;
|
|
32
|
-
readonly onDidChangeCurrentTerminal: Event<TerminalWidget | undefined>;
|
|
33
|
-
readonly lastUsedTerminal: TerminalWidget | undefined;
|
|
34
|
-
}
|
|
1
|
+
import { Event } from '@theia/core/lib/common/event';
|
|
2
|
+
import { WidgetOpenerOptions } from '@theia/core/lib/browser';
|
|
3
|
+
import { TerminalWidgetOptions, TerminalWidget } from './terminal-widget';
|
|
4
|
+
/**
|
|
5
|
+
* Service manipulating terminal widgets.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TerminalService: unique symbol;
|
|
8
|
+
export interface TerminalService {
|
|
9
|
+
/**
|
|
10
|
+
* Create new terminal with predefined options.
|
|
11
|
+
* @param options - terminal options.
|
|
12
|
+
*/
|
|
13
|
+
newTerminal(options: TerminalWidgetOptions): Promise<TerminalWidget>;
|
|
14
|
+
open(terminal: TerminalWidget, options?: WidgetOpenerOptions): void;
|
|
15
|
+
readonly all: TerminalWidget[];
|
|
16
|
+
/**
|
|
17
|
+
* @param id - the widget id (NOT the terminal id!)
|
|
18
|
+
* @return the widget
|
|
19
|
+
*/
|
|
20
|
+
getById(id: string): TerminalWidget | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* @param id - the terminal id (NOT the terminal widget id!)
|
|
23
|
+
* @return the widget
|
|
24
|
+
*/
|
|
25
|
+
getByTerminalId(terminalId: number): TerminalWidget | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Returns detected default shell.
|
|
28
|
+
*/
|
|
29
|
+
getDefaultShell(): Promise<string>;
|
|
30
|
+
readonly onDidCreateTerminal: Event<TerminalWidget>;
|
|
31
|
+
readonly currentTerminal: TerminalWidget | undefined;
|
|
32
|
+
readonly onDidChangeCurrentTerminal: Event<TerminalWidget | undefined>;
|
|
33
|
+
readonly lastUsedTerminal: TerminalWidget | undefined;
|
|
34
|
+
}
|
|
35
35
|
//# sourceMappingURL=terminal-service.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TerminalService = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Service manipulating terminal widgets.
|
|
6
|
-
*/
|
|
7
|
-
exports.TerminalService = Symbol('TerminalService');
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalService = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Service manipulating terminal widgets.
|
|
6
|
+
*/
|
|
7
|
+
exports.TerminalService = Symbol('TerminalService');
|
|
8
8
|
//# sourceMappingURL=terminal-service.js.map
|
|
@@ -1,193 +1,193 @@
|
|
|
1
|
-
import { Event, ViewColumn } from '@theia/core';
|
|
2
|
-
import { BaseWidget } from '@theia/core/lib/browser';
|
|
3
|
-
import { CommandLineOptions } from '@theia/process/lib/common/shell-command-builder';
|
|
4
|
-
import { TerminalSearchWidget } from '../search/terminal-search-widget';
|
|
5
|
-
import { TerminalProcessInfo, TerminalExitReason } from '../../common/base-terminal-protocol';
|
|
6
|
-
import URI from '@theia/core/lib/common/uri';
|
|
7
|
-
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string';
|
|
8
|
-
export interface TerminalDimensions {
|
|
9
|
-
cols: number;
|
|
10
|
-
rows: number;
|
|
11
|
-
}
|
|
12
|
-
export interface TerminalExitStatus {
|
|
13
|
-
readonly code: number | undefined;
|
|
14
|
-
readonly reason: TerminalExitReason;
|
|
15
|
-
}
|
|
16
|
-
export declare type TerminalLocationOptions = TerminalLocation | TerminalEditorLocation | TerminalSplitLocation;
|
|
17
|
-
export declare enum TerminalLocation {
|
|
18
|
-
Panel = 1,
|
|
19
|
-
Editor = 2
|
|
20
|
-
}
|
|
21
|
-
export interface TerminalEditorLocation {
|
|
22
|
-
readonly viewColumn: ViewColumn;
|
|
23
|
-
readonly preserveFocus?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export interface TerminalSplitLocation {
|
|
26
|
-
readonly parentTerminal: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Terminal UI widget.
|
|
30
|
-
*/
|
|
31
|
-
export declare abstract class TerminalWidget extends BaseWidget {
|
|
32
|
-
abstract processId: Promise<number>;
|
|
33
|
-
/**
|
|
34
|
-
* Get the current executable and arguments.
|
|
35
|
-
*/
|
|
36
|
-
abstract processInfo: Promise<TerminalProcessInfo>;
|
|
37
|
-
/** The ids of extensions contributing to the environment of this terminal mapped to the provided description for their changes. */
|
|
38
|
-
abstract envVarCollectionDescriptionsByExtension: Promise<Map<string, (string | MarkdownString | undefined)[]>>;
|
|
39
|
-
/** Terminal kind that indicates whether a terminal is created by a user or by some extension for a user */
|
|
40
|
-
abstract readonly kind: 'user' | string;
|
|
41
|
-
abstract readonly terminalId: number;
|
|
42
|
-
abstract readonly dimensions: TerminalDimensions;
|
|
43
|
-
abstract readonly exitStatus: TerminalExitStatus | undefined;
|
|
44
|
-
/** Terminal widget can be hidden from users until explicitly shown once. */
|
|
45
|
-
abstract readonly hiddenFromUser: boolean;
|
|
46
|
-
/** The position of the terminal widget. */
|
|
47
|
-
abstract readonly location: TerminalLocationOptions;
|
|
48
|
-
/** The last CWD assigned to the terminal, useful when attempting getCwdURI on a task terminal fails */
|
|
49
|
-
lastCwd: URI;
|
|
50
|
-
/**
|
|
51
|
-
* Start terminal and return terminal id.
|
|
52
|
-
* @param id - terminal id.
|
|
53
|
-
*/
|
|
54
|
-
abstract start(id?: number): Promise<number>;
|
|
55
|
-
/**
|
|
56
|
-
* Send text to the terminal server.
|
|
57
|
-
* @param text - text content.
|
|
58
|
-
*/
|
|
59
|
-
abstract sendText(text: string): void;
|
|
60
|
-
/**
|
|
61
|
-
* Resolves when the command is successfully sent, this doesn't mean that it
|
|
62
|
-
* was evaluated. Might reject if terminal wasn't properly started yet.
|
|
63
|
-
*
|
|
64
|
-
* Note that this method will try to escape your arguments as if it was
|
|
65
|
-
* someone inputting everything in a shell.
|
|
66
|
-
*
|
|
67
|
-
* Supported shells: `bash`, `cmd.exe`, `wsl.exe`, `pwsh/powershell.exe`
|
|
68
|
-
*/
|
|
69
|
-
abstract executeCommand(commandOptions: CommandLineOptions): Promise<void>;
|
|
70
|
-
/** Event that fires when the terminal is connected or reconnected */
|
|
71
|
-
abstract onDidOpen: Event<void>;
|
|
72
|
-
/** Event that fires when the terminal fails to connect or reconnect */
|
|
73
|
-
abstract onDidOpenFailure: Event<void>;
|
|
74
|
-
/** Event that fires when the terminal size changed */
|
|
75
|
-
abstract onSizeChanged: Event<{
|
|
76
|
-
cols: number;
|
|
77
|
-
rows: number;
|
|
78
|
-
}>;
|
|
79
|
-
/** Event that fires when the terminal receives a key event. */
|
|
80
|
-
abstract onKey: Event<{
|
|
81
|
-
key: string;
|
|
82
|
-
domEvent: KeyboardEvent;
|
|
83
|
-
}>;
|
|
84
|
-
/** Event that fires when the terminal input data */
|
|
85
|
-
abstract onData: Event<string>;
|
|
86
|
-
abstract scrollLineUp(): void;
|
|
87
|
-
abstract scrollLineDown(): void;
|
|
88
|
-
abstract scrollToTop(): void;
|
|
89
|
-
abstract scrollToBottom(): void;
|
|
90
|
-
abstract scrollPageUp(): void;
|
|
91
|
-
abstract scrollPageDown(): void;
|
|
92
|
-
abstract resetTerminal(): void;
|
|
93
|
-
/**
|
|
94
|
-
* Event which fires when terminal did closed. Event value contains closed terminal widget definition.
|
|
95
|
-
*/
|
|
96
|
-
abstract onTerminalDidClose: Event<TerminalWidget>;
|
|
97
|
-
/**
|
|
98
|
-
* Cleat terminal output.
|
|
99
|
-
*/
|
|
100
|
-
abstract clearOutput(): void;
|
|
101
|
-
/**
|
|
102
|
-
* Select entire content in the terminal.
|
|
103
|
-
*/
|
|
104
|
-
abstract selectAll(): void;
|
|
105
|
-
abstract writeLine(line: string): void;
|
|
106
|
-
abstract write(data: string): void;
|
|
107
|
-
abstract resize(cols: number, rows: number): void;
|
|
108
|
-
/**
|
|
109
|
-
* Return Terminal search box widget.
|
|
110
|
-
*/
|
|
111
|
-
abstract getSearchBox(): TerminalSearchWidget;
|
|
112
|
-
/**
|
|
113
|
-
* Whether the terminal process has child processes.
|
|
114
|
-
*/
|
|
115
|
-
abstract hasChildProcesses(): Promise<boolean>;
|
|
116
|
-
abstract setTitle(title: string): void;
|
|
117
|
-
abstract waitOnExit(waitOnExit?: boolean | string): void;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Terminal widget options.
|
|
121
|
-
*/
|
|
122
|
-
export declare const TerminalWidgetOptions: unique symbol;
|
|
123
|
-
export interface TerminalWidgetOptions {
|
|
124
|
-
/**
|
|
125
|
-
* Human readable terminal representation on the UI.
|
|
126
|
-
*/
|
|
127
|
-
readonly title?: string;
|
|
128
|
-
/**
|
|
129
|
-
* icon class
|
|
130
|
-
*/
|
|
131
|
-
readonly iconClass?: string;
|
|
132
|
-
/**
|
|
133
|
-
* Path to the executable shell. For example: `/bin/bash`, `bash`, `sh`.
|
|
134
|
-
*/
|
|
135
|
-
readonly shellPath?: string;
|
|
136
|
-
/**
|
|
137
|
-
* Args for the custom shell executable. A string can be used on Windows only which allows
|
|
138
|
-
* specifying shell args in [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).
|
|
139
|
-
*/
|
|
140
|
-
readonly shellArgs?: string[] | string;
|
|
141
|
-
/**
|
|
142
|
-
* Current working directory.
|
|
143
|
-
*/
|
|
144
|
-
readonly cwd?: string | URI;
|
|
145
|
-
/**
|
|
146
|
-
* Environment variables for terminal.
|
|
147
|
-
*/
|
|
148
|
-
readonly env?: {
|
|
149
|
-
[key: string]: string | null;
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* Whether the terminal process environment should be exactly as provided in `env`.
|
|
153
|
-
*/
|
|
154
|
-
readonly strictEnv?: boolean;
|
|
155
|
-
/**
|
|
156
|
-
* In case `destroyTermOnClose` is true - terminal process will be destroyed on close terminal widget, otherwise will be kept
|
|
157
|
-
* alive.
|
|
158
|
-
*/
|
|
159
|
-
readonly destroyTermOnClose?: boolean;
|
|
160
|
-
/**
|
|
161
|
-
* Terminal server side can send to the client `terminal title` to display this value on the UI. If
|
|
162
|
-
* useServerTitle = true then display this title, otherwise display title defined by 'title' argument.
|
|
163
|
-
*/
|
|
164
|
-
readonly useServerTitle?: boolean;
|
|
165
|
-
/**
|
|
166
|
-
* Whether it is a pseudo terminal where an extension controls its input and output.
|
|
167
|
-
*/
|
|
168
|
-
readonly isPseudoTerminal?: boolean;
|
|
169
|
-
/**
|
|
170
|
-
* Terminal id. Should be unique for all DOM.
|
|
171
|
-
*/
|
|
172
|
-
readonly id?: string;
|
|
173
|
-
/**
|
|
174
|
-
* Terminal attributes. Can be useful to apply some implementation specific information.
|
|
175
|
-
*/
|
|
176
|
-
readonly attributes?: {
|
|
177
|
-
[key: string]: string | null;
|
|
178
|
-
};
|
|
179
|
-
/**
|
|
180
|
-
* Terminal kind that indicates whether a terminal is created by a user or by some extension for a user
|
|
181
|
-
*/
|
|
182
|
-
readonly kind?: 'user' | string;
|
|
183
|
-
/**
|
|
184
|
-
* When enabled the terminal will run the process as normal but not be surfaced to the user until `Terminal.show` is called.
|
|
185
|
-
*/
|
|
186
|
-
readonly hideFromUser?: boolean;
|
|
187
|
-
readonly location?: TerminalLocationOptions;
|
|
188
|
-
/**
|
|
189
|
-
* When enabled, the terminal will not be persisted across window reloads.
|
|
190
|
-
*/
|
|
191
|
-
readonly isTransient?: boolean;
|
|
192
|
-
}
|
|
1
|
+
import { Event, ViewColumn } from '@theia/core';
|
|
2
|
+
import { BaseWidget } from '@theia/core/lib/browser';
|
|
3
|
+
import { CommandLineOptions } from '@theia/process/lib/common/shell-command-builder';
|
|
4
|
+
import { TerminalSearchWidget } from '../search/terminal-search-widget';
|
|
5
|
+
import { TerminalProcessInfo, TerminalExitReason } from '../../common/base-terminal-protocol';
|
|
6
|
+
import URI from '@theia/core/lib/common/uri';
|
|
7
|
+
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string';
|
|
8
|
+
export interface TerminalDimensions {
|
|
9
|
+
cols: number;
|
|
10
|
+
rows: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TerminalExitStatus {
|
|
13
|
+
readonly code: number | undefined;
|
|
14
|
+
readonly reason: TerminalExitReason;
|
|
15
|
+
}
|
|
16
|
+
export declare type TerminalLocationOptions = TerminalLocation | TerminalEditorLocation | TerminalSplitLocation;
|
|
17
|
+
export declare enum TerminalLocation {
|
|
18
|
+
Panel = 1,
|
|
19
|
+
Editor = 2
|
|
20
|
+
}
|
|
21
|
+
export interface TerminalEditorLocation {
|
|
22
|
+
readonly viewColumn: ViewColumn;
|
|
23
|
+
readonly preserveFocus?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface TerminalSplitLocation {
|
|
26
|
+
readonly parentTerminal: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Terminal UI widget.
|
|
30
|
+
*/
|
|
31
|
+
export declare abstract class TerminalWidget extends BaseWidget {
|
|
32
|
+
abstract processId: Promise<number>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the current executable and arguments.
|
|
35
|
+
*/
|
|
36
|
+
abstract processInfo: Promise<TerminalProcessInfo>;
|
|
37
|
+
/** The ids of extensions contributing to the environment of this terminal mapped to the provided description for their changes. */
|
|
38
|
+
abstract envVarCollectionDescriptionsByExtension: Promise<Map<string, (string | MarkdownString | undefined)[]>>;
|
|
39
|
+
/** Terminal kind that indicates whether a terminal is created by a user or by some extension for a user */
|
|
40
|
+
abstract readonly kind: 'user' | string;
|
|
41
|
+
abstract readonly terminalId: number;
|
|
42
|
+
abstract readonly dimensions: TerminalDimensions;
|
|
43
|
+
abstract readonly exitStatus: TerminalExitStatus | undefined;
|
|
44
|
+
/** Terminal widget can be hidden from users until explicitly shown once. */
|
|
45
|
+
abstract readonly hiddenFromUser: boolean;
|
|
46
|
+
/** The position of the terminal widget. */
|
|
47
|
+
abstract readonly location: TerminalLocationOptions;
|
|
48
|
+
/** The last CWD assigned to the terminal, useful when attempting getCwdURI on a task terminal fails */
|
|
49
|
+
lastCwd: URI;
|
|
50
|
+
/**
|
|
51
|
+
* Start terminal and return terminal id.
|
|
52
|
+
* @param id - terminal id.
|
|
53
|
+
*/
|
|
54
|
+
abstract start(id?: number): Promise<number>;
|
|
55
|
+
/**
|
|
56
|
+
* Send text to the terminal server.
|
|
57
|
+
* @param text - text content.
|
|
58
|
+
*/
|
|
59
|
+
abstract sendText(text: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* Resolves when the command is successfully sent, this doesn't mean that it
|
|
62
|
+
* was evaluated. Might reject if terminal wasn't properly started yet.
|
|
63
|
+
*
|
|
64
|
+
* Note that this method will try to escape your arguments as if it was
|
|
65
|
+
* someone inputting everything in a shell.
|
|
66
|
+
*
|
|
67
|
+
* Supported shells: `bash`, `cmd.exe`, `wsl.exe`, `pwsh/powershell.exe`
|
|
68
|
+
*/
|
|
69
|
+
abstract executeCommand(commandOptions: CommandLineOptions): Promise<void>;
|
|
70
|
+
/** Event that fires when the terminal is connected or reconnected */
|
|
71
|
+
abstract onDidOpen: Event<void>;
|
|
72
|
+
/** Event that fires when the terminal fails to connect or reconnect */
|
|
73
|
+
abstract onDidOpenFailure: Event<void>;
|
|
74
|
+
/** Event that fires when the terminal size changed */
|
|
75
|
+
abstract onSizeChanged: Event<{
|
|
76
|
+
cols: number;
|
|
77
|
+
rows: number;
|
|
78
|
+
}>;
|
|
79
|
+
/** Event that fires when the terminal receives a key event. */
|
|
80
|
+
abstract onKey: Event<{
|
|
81
|
+
key: string;
|
|
82
|
+
domEvent: KeyboardEvent;
|
|
83
|
+
}>;
|
|
84
|
+
/** Event that fires when the terminal input data */
|
|
85
|
+
abstract onData: Event<string>;
|
|
86
|
+
abstract scrollLineUp(): void;
|
|
87
|
+
abstract scrollLineDown(): void;
|
|
88
|
+
abstract scrollToTop(): void;
|
|
89
|
+
abstract scrollToBottom(): void;
|
|
90
|
+
abstract scrollPageUp(): void;
|
|
91
|
+
abstract scrollPageDown(): void;
|
|
92
|
+
abstract resetTerminal(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Event which fires when terminal did closed. Event value contains closed terminal widget definition.
|
|
95
|
+
*/
|
|
96
|
+
abstract onTerminalDidClose: Event<TerminalWidget>;
|
|
97
|
+
/**
|
|
98
|
+
* Cleat terminal output.
|
|
99
|
+
*/
|
|
100
|
+
abstract clearOutput(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Select entire content in the terminal.
|
|
103
|
+
*/
|
|
104
|
+
abstract selectAll(): void;
|
|
105
|
+
abstract writeLine(line: string): void;
|
|
106
|
+
abstract write(data: string): void;
|
|
107
|
+
abstract resize(cols: number, rows: number): void;
|
|
108
|
+
/**
|
|
109
|
+
* Return Terminal search box widget.
|
|
110
|
+
*/
|
|
111
|
+
abstract getSearchBox(): TerminalSearchWidget;
|
|
112
|
+
/**
|
|
113
|
+
* Whether the terminal process has child processes.
|
|
114
|
+
*/
|
|
115
|
+
abstract hasChildProcesses(): Promise<boolean>;
|
|
116
|
+
abstract setTitle(title: string): void;
|
|
117
|
+
abstract waitOnExit(waitOnExit?: boolean | string): void;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Terminal widget options.
|
|
121
|
+
*/
|
|
122
|
+
export declare const TerminalWidgetOptions: unique symbol;
|
|
123
|
+
export interface TerminalWidgetOptions {
|
|
124
|
+
/**
|
|
125
|
+
* Human readable terminal representation on the UI.
|
|
126
|
+
*/
|
|
127
|
+
readonly title?: string;
|
|
128
|
+
/**
|
|
129
|
+
* icon class
|
|
130
|
+
*/
|
|
131
|
+
readonly iconClass?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Path to the executable shell. For example: `/bin/bash`, `bash`, `sh`.
|
|
134
|
+
*/
|
|
135
|
+
readonly shellPath?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Args for the custom shell executable. A string can be used on Windows only which allows
|
|
138
|
+
* specifying shell args in [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).
|
|
139
|
+
*/
|
|
140
|
+
readonly shellArgs?: string[] | string;
|
|
141
|
+
/**
|
|
142
|
+
* Current working directory.
|
|
143
|
+
*/
|
|
144
|
+
readonly cwd?: string | URI;
|
|
145
|
+
/**
|
|
146
|
+
* Environment variables for terminal.
|
|
147
|
+
*/
|
|
148
|
+
readonly env?: {
|
|
149
|
+
[key: string]: string | null;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Whether the terminal process environment should be exactly as provided in `env`.
|
|
153
|
+
*/
|
|
154
|
+
readonly strictEnv?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* In case `destroyTermOnClose` is true - terminal process will be destroyed on close terminal widget, otherwise will be kept
|
|
157
|
+
* alive.
|
|
158
|
+
*/
|
|
159
|
+
readonly destroyTermOnClose?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Terminal server side can send to the client `terminal title` to display this value on the UI. If
|
|
162
|
+
* useServerTitle = true then display this title, otherwise display title defined by 'title' argument.
|
|
163
|
+
*/
|
|
164
|
+
readonly useServerTitle?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Whether it is a pseudo terminal where an extension controls its input and output.
|
|
167
|
+
*/
|
|
168
|
+
readonly isPseudoTerminal?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Terminal id. Should be unique for all DOM.
|
|
171
|
+
*/
|
|
172
|
+
readonly id?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Terminal attributes. Can be useful to apply some implementation specific information.
|
|
175
|
+
*/
|
|
176
|
+
readonly attributes?: {
|
|
177
|
+
[key: string]: string | null;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Terminal kind that indicates whether a terminal is created by a user or by some extension for a user
|
|
181
|
+
*/
|
|
182
|
+
readonly kind?: 'user' | string;
|
|
183
|
+
/**
|
|
184
|
+
* When enabled the terminal will run the process as normal but not be surfaced to the user until `Terminal.show` is called.
|
|
185
|
+
*/
|
|
186
|
+
readonly hideFromUser?: boolean;
|
|
187
|
+
readonly location?: TerminalLocationOptions;
|
|
188
|
+
/**
|
|
189
|
+
* When enabled, the terminal will not be persisted across window reloads.
|
|
190
|
+
*/
|
|
191
|
+
readonly isTransient?: boolean;
|
|
192
|
+
}
|
|
193
193
|
//# sourceMappingURL=terminal-widget.d.ts.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.TerminalWidgetOptions = exports.TerminalWidget = exports.TerminalLocation = void 0;
|
|
19
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
20
|
-
var TerminalLocation;
|
|
21
|
-
(function (TerminalLocation) {
|
|
22
|
-
TerminalLocation[TerminalLocation["Panel"] = 1] = "Panel";
|
|
23
|
-
TerminalLocation[TerminalLocation["Editor"] = 2] = "Editor";
|
|
24
|
-
})(TerminalLocation = exports.TerminalLocation || (exports.TerminalLocation = {}));
|
|
25
|
-
/**
|
|
26
|
-
* Terminal UI widget.
|
|
27
|
-
*/
|
|
28
|
-
class TerminalWidget extends browser_1.BaseWidget {
|
|
29
|
-
}
|
|
30
|
-
exports.TerminalWidget = TerminalWidget;
|
|
31
|
-
/**
|
|
32
|
-
* Terminal widget options.
|
|
33
|
-
*/
|
|
34
|
-
exports.TerminalWidgetOptions = Symbol('TerminalWidgetOptions');
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TerminalWidgetOptions = exports.TerminalWidget = exports.TerminalLocation = void 0;
|
|
19
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
20
|
+
var TerminalLocation;
|
|
21
|
+
(function (TerminalLocation) {
|
|
22
|
+
TerminalLocation[TerminalLocation["Panel"] = 1] = "Panel";
|
|
23
|
+
TerminalLocation[TerminalLocation["Editor"] = 2] = "Editor";
|
|
24
|
+
})(TerminalLocation = exports.TerminalLocation || (exports.TerminalLocation = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Terminal UI widget.
|
|
27
|
+
*/
|
|
28
|
+
class TerminalWidget extends browser_1.BaseWidget {
|
|
29
|
+
}
|
|
30
|
+
exports.TerminalWidget = TerminalWidget;
|
|
31
|
+
/**
|
|
32
|
+
* Terminal widget options.
|
|
33
|
+
*/
|
|
34
|
+
exports.TerminalWidgetOptions = Symbol('TerminalWidgetOptions');
|
|
35
35
|
//# sourceMappingURL=terminal-widget.js.map
|
package/lib/browser/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './terminal-frontend-module';
|
|
1
|
+
export * from './terminal-frontend-module';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|