@theia/terminal 1.45.1 → 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
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2017 Ericsson 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 { RpcServer } from '@theia/core/lib/common/messaging/proxy-factory';
|
|
18
|
-
import { Disposable } from '@theia/core';
|
|
19
|
-
|
|
20
|
-
export interface TerminalProcessInfo {
|
|
21
|
-
executable: string
|
|
22
|
-
arguments: string[]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface IBaseTerminalServerOptions { }
|
|
26
|
-
|
|
27
|
-
export interface IBaseTerminalServer extends RpcServer<IBaseTerminalClient> {
|
|
28
|
-
create(IBaseTerminalServerOptions: object): Promise<number>;
|
|
29
|
-
getProcessId(id: number): Promise<number>;
|
|
30
|
-
getProcessInfo(id: number): Promise<TerminalProcessInfo>;
|
|
31
|
-
getCwdURI(id: number): Promise<string>;
|
|
32
|
-
resize(id: number, cols: number, rows: number): Promise<void>;
|
|
33
|
-
attach(id: number): Promise<number>;
|
|
34
|
-
onAttachAttempted(id: number): Promise<void>;
|
|
35
|
-
close(id: number): Promise<void>;
|
|
36
|
-
getDefaultShell(): Promise<string>;
|
|
37
|
-
}
|
|
38
|
-
export namespace IBaseTerminalServer {
|
|
39
|
-
export function validateId(id?: number): boolean {
|
|
40
|
-
return typeof id === 'number' && id !== -1;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface IBaseTerminalExitEvent {
|
|
45
|
-
terminalId: number;
|
|
46
|
-
|
|
47
|
-
// Either code and reason will be set or signal.
|
|
48
|
-
code?: number;
|
|
49
|
-
reason?: TerminalExitReason;
|
|
50
|
-
signal?: string;
|
|
51
|
-
|
|
52
|
-
attached?: boolean;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export enum TerminalExitReason {
|
|
56
|
-
Unknown = 0,
|
|
57
|
-
Shutdown = 1,
|
|
58
|
-
Process = 2,
|
|
59
|
-
User = 3,
|
|
60
|
-
Extension = 4,
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface IBaseTerminalErrorEvent {
|
|
64
|
-
terminalId: number;
|
|
65
|
-
error: Error;
|
|
66
|
-
attached?: boolean;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface IBaseTerminalClient {
|
|
70
|
-
onTerminalExitChanged(event: IBaseTerminalExitEvent): void;
|
|
71
|
-
onTerminalError(event: IBaseTerminalErrorEvent): void;
|
|
72
|
-
updateTerminalEnvVariables(): void;
|
|
73
|
-
storeTerminalEnvVariables(data: string): void;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export class DispatchingBaseTerminalClient {
|
|
77
|
-
|
|
78
|
-
protected readonly clients = new Set<IBaseTerminalClient>();
|
|
79
|
-
|
|
80
|
-
push(client: IBaseTerminalClient): Disposable {
|
|
81
|
-
this.clients.add(client);
|
|
82
|
-
return Disposable.create(() => this.clients.delete(client));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
onTerminalExitChanged(event: IBaseTerminalExitEvent): void {
|
|
86
|
-
this.clients.forEach(c => {
|
|
87
|
-
try {
|
|
88
|
-
c.onTerminalExitChanged(event);
|
|
89
|
-
} catch (e) {
|
|
90
|
-
console.error(e);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
onTerminalError(event: IBaseTerminalErrorEvent): void {
|
|
96
|
-
|
|
97
|
-
this.clients.forEach(c => {
|
|
98
|
-
try {
|
|
99
|
-
c.onTerminalError(event);
|
|
100
|
-
} catch (e) {
|
|
101
|
-
console.error(e);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
updateTerminalEnvVariables(): void {
|
|
107
|
-
this.clients.forEach(c => {
|
|
108
|
-
try {
|
|
109
|
-
c.updateTerminalEnvVariables();
|
|
110
|
-
} catch (e) {
|
|
111
|
-
console.error(e);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
storeTerminalEnvVariables(data: string): void {
|
|
117
|
-
this.clients.forEach(c => {
|
|
118
|
-
try {
|
|
119
|
-
c.storeTerminalEnvVariables(data);
|
|
120
|
-
} catch (e) {
|
|
121
|
-
console.error(e);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 Ericsson 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 { RpcServer } from '@theia/core/lib/common/messaging/proxy-factory';
|
|
18
|
+
import { Disposable } from '@theia/core';
|
|
19
|
+
|
|
20
|
+
export interface TerminalProcessInfo {
|
|
21
|
+
executable: string
|
|
22
|
+
arguments: string[]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface IBaseTerminalServerOptions { }
|
|
26
|
+
|
|
27
|
+
export interface IBaseTerminalServer extends RpcServer<IBaseTerminalClient> {
|
|
28
|
+
create(IBaseTerminalServerOptions: object): Promise<number>;
|
|
29
|
+
getProcessId(id: number): Promise<number>;
|
|
30
|
+
getProcessInfo(id: number): Promise<TerminalProcessInfo>;
|
|
31
|
+
getCwdURI(id: number): Promise<string>;
|
|
32
|
+
resize(id: number, cols: number, rows: number): Promise<void>;
|
|
33
|
+
attach(id: number): Promise<number>;
|
|
34
|
+
onAttachAttempted(id: number): Promise<void>;
|
|
35
|
+
close(id: number): Promise<void>;
|
|
36
|
+
getDefaultShell(): Promise<string>;
|
|
37
|
+
}
|
|
38
|
+
export namespace IBaseTerminalServer {
|
|
39
|
+
export function validateId(id?: number): boolean {
|
|
40
|
+
return typeof id === 'number' && id !== -1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface IBaseTerminalExitEvent {
|
|
45
|
+
terminalId: number;
|
|
46
|
+
|
|
47
|
+
// Either code and reason will be set or signal.
|
|
48
|
+
code?: number;
|
|
49
|
+
reason?: TerminalExitReason;
|
|
50
|
+
signal?: string;
|
|
51
|
+
|
|
52
|
+
attached?: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export enum TerminalExitReason {
|
|
56
|
+
Unknown = 0,
|
|
57
|
+
Shutdown = 1,
|
|
58
|
+
Process = 2,
|
|
59
|
+
User = 3,
|
|
60
|
+
Extension = 4,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface IBaseTerminalErrorEvent {
|
|
64
|
+
terminalId: number;
|
|
65
|
+
error: Error;
|
|
66
|
+
attached?: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface IBaseTerminalClient {
|
|
70
|
+
onTerminalExitChanged(event: IBaseTerminalExitEvent): void;
|
|
71
|
+
onTerminalError(event: IBaseTerminalErrorEvent): void;
|
|
72
|
+
updateTerminalEnvVariables(): void;
|
|
73
|
+
storeTerminalEnvVariables(data: string): void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export class DispatchingBaseTerminalClient {
|
|
77
|
+
|
|
78
|
+
protected readonly clients = new Set<IBaseTerminalClient>();
|
|
79
|
+
|
|
80
|
+
push(client: IBaseTerminalClient): Disposable {
|
|
81
|
+
this.clients.add(client);
|
|
82
|
+
return Disposable.create(() => this.clients.delete(client));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
onTerminalExitChanged(event: IBaseTerminalExitEvent): void {
|
|
86
|
+
this.clients.forEach(c => {
|
|
87
|
+
try {
|
|
88
|
+
c.onTerminalExitChanged(event);
|
|
89
|
+
} catch (e) {
|
|
90
|
+
console.error(e);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
onTerminalError(event: IBaseTerminalErrorEvent): void {
|
|
96
|
+
|
|
97
|
+
this.clients.forEach(c => {
|
|
98
|
+
try {
|
|
99
|
+
c.onTerminalError(event);
|
|
100
|
+
} catch (e) {
|
|
101
|
+
console.error(e);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
updateTerminalEnvVariables(): void {
|
|
107
|
+
this.clients.forEach(c => {
|
|
108
|
+
try {
|
|
109
|
+
c.updateTerminalEnvVariables();
|
|
110
|
+
} catch (e) {
|
|
111
|
+
console.error(e);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
storeTerminalEnvVariables(data: string): void {
|
|
117
|
+
this.clients.forEach(c => {
|
|
118
|
+
try {
|
|
119
|
+
c.storeTerminalEnvVariables(data);
|
|
120
|
+
} catch (e) {
|
|
121
|
+
console.error(e);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2017 Ericsson 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 { RpcProxy } from '@theia/core';
|
|
18
|
-
import { IBaseTerminalServer, IBaseTerminalServerOptions } from './base-terminal-protocol';
|
|
19
|
-
import { OS } from '@theia/core/lib/common/os';
|
|
20
|
-
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string';
|
|
21
|
-
|
|
22
|
-
export const IShellTerminalServer = Symbol('IShellTerminalServer');
|
|
23
|
-
|
|
24
|
-
export interface IShellTerminalServer extends IBaseTerminalServer {
|
|
25
|
-
hasChildProcesses(processId: number | undefined): Promise<boolean>;
|
|
26
|
-
getEnvVarCollectionDescriptionsByExtension(id: number): Promise<Map<string, (string | MarkdownString | undefined)[]>>;
|
|
27
|
-
getEnvVarCollections(): Promise<[string, string, boolean, SerializableEnvironmentVariableCollection][]>;
|
|
28
|
-
|
|
29
|
-
restorePersisted(jsonValue: string): void;
|
|
30
|
-
/**
|
|
31
|
-
* Sets an extension's environment variable collection.
|
|
32
|
-
*/
|
|
33
|
-
setCollection(extensionIdentifier: string, rootUri: string, persistent: boolean,
|
|
34
|
-
collection: SerializableEnvironmentVariableCollection, description: string | MarkdownString | undefined): void;
|
|
35
|
-
/**
|
|
36
|
-
* Deletes an extension's environment variable collection.
|
|
37
|
-
*/
|
|
38
|
-
deleteCollection(extensionIdentifier: string): void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const shellTerminalPath = '/services/shell-terminal';
|
|
42
|
-
|
|
43
|
-
export type ShellTerminalOSPreferences<T> = {
|
|
44
|
-
[key in OS.Type]: T
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export interface IShellTerminalPreferences {
|
|
48
|
-
shell: ShellTerminalOSPreferences<string | undefined>,
|
|
49
|
-
shellArgs: ShellTerminalOSPreferences<string[]>
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export interface IShellTerminalServerOptions extends IBaseTerminalServerOptions {
|
|
53
|
-
shell?: string,
|
|
54
|
-
args?: string[] | string,
|
|
55
|
-
rootURI?: string,
|
|
56
|
-
cols?: number,
|
|
57
|
-
rows?: number,
|
|
58
|
-
env?: { [key: string]: string | null },
|
|
59
|
-
strictEnv?: boolean,
|
|
60
|
-
isPseudo?: boolean,
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export const ShellTerminalServerProxy = Symbol('ShellTerminalServerProxy');
|
|
64
|
-
export type ShellTerminalServerProxy = RpcProxy<IShellTerminalServer>;
|
|
65
|
-
|
|
66
|
-
/*---------------------------------------------------------------------------------------------
|
|
67
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
68
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
69
|
-
*--------------------------------------------------------------------------------------------*/
|
|
70
|
-
// some code copied and modified from https://github.com/microsoft/vscode/blob/1.49.0/src/vs/workbench/contrib/terminal/common/environmentVariable.ts
|
|
71
|
-
|
|
72
|
-
export const NO_ROOT_URI = '<none>';
|
|
73
|
-
|
|
74
|
-
export interface EnvironmentVariableCollection {
|
|
75
|
-
readonly variableMutators: ReadonlyMap<string, EnvironmentVariableMutator>;
|
|
76
|
-
readonly description: string | MarkdownString | undefined;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface EnvironmentVariableCollectionWithPersistence extends EnvironmentVariableCollection {
|
|
80
|
-
readonly persistent: boolean;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export enum EnvironmentVariableMutatorType {
|
|
84
|
-
Replace = 1,
|
|
85
|
-
Append = 2,
|
|
86
|
-
Prepend = 3
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface EnvironmentVariableMutatorOptions {
|
|
90
|
-
applyAtProcessCreation?: boolean;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface EnvironmentVariableMutator {
|
|
94
|
-
readonly value: string;
|
|
95
|
-
readonly type: EnvironmentVariableMutatorType;
|
|
96
|
-
readonly options: EnvironmentVariableMutatorOptions;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface SerializableEnvironmentVariableCollection {
|
|
100
|
-
readonly description: string | MarkdownString | undefined;
|
|
101
|
-
readonly mutators: [string, EnvironmentVariableMutator][]
|
|
102
|
-
};
|
|
103
|
-
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 Ericsson 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 { RpcProxy } from '@theia/core';
|
|
18
|
+
import { IBaseTerminalServer, IBaseTerminalServerOptions } from './base-terminal-protocol';
|
|
19
|
+
import { OS } from '@theia/core/lib/common/os';
|
|
20
|
+
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string';
|
|
21
|
+
|
|
22
|
+
export const IShellTerminalServer = Symbol('IShellTerminalServer');
|
|
23
|
+
|
|
24
|
+
export interface IShellTerminalServer extends IBaseTerminalServer {
|
|
25
|
+
hasChildProcesses(processId: number | undefined): Promise<boolean>;
|
|
26
|
+
getEnvVarCollectionDescriptionsByExtension(id: number): Promise<Map<string, (string | MarkdownString | undefined)[]>>;
|
|
27
|
+
getEnvVarCollections(): Promise<[string, string, boolean, SerializableEnvironmentVariableCollection][]>;
|
|
28
|
+
|
|
29
|
+
restorePersisted(jsonValue: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Sets an extension's environment variable collection.
|
|
32
|
+
*/
|
|
33
|
+
setCollection(extensionIdentifier: string, rootUri: string, persistent: boolean,
|
|
34
|
+
collection: SerializableEnvironmentVariableCollection, description: string | MarkdownString | undefined): void;
|
|
35
|
+
/**
|
|
36
|
+
* Deletes an extension's environment variable collection.
|
|
37
|
+
*/
|
|
38
|
+
deleteCollection(extensionIdentifier: string): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const shellTerminalPath = '/services/shell-terminal';
|
|
42
|
+
|
|
43
|
+
export type ShellTerminalOSPreferences<T> = {
|
|
44
|
+
[key in OS.Type]: T
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export interface IShellTerminalPreferences {
|
|
48
|
+
shell: ShellTerminalOSPreferences<string | undefined>,
|
|
49
|
+
shellArgs: ShellTerminalOSPreferences<string[]>
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export interface IShellTerminalServerOptions extends IBaseTerminalServerOptions {
|
|
53
|
+
shell?: string,
|
|
54
|
+
args?: string[] | string,
|
|
55
|
+
rootURI?: string,
|
|
56
|
+
cols?: number,
|
|
57
|
+
rows?: number,
|
|
58
|
+
env?: { [key: string]: string | null },
|
|
59
|
+
strictEnv?: boolean,
|
|
60
|
+
isPseudo?: boolean,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const ShellTerminalServerProxy = Symbol('ShellTerminalServerProxy');
|
|
64
|
+
export type ShellTerminalServerProxy = RpcProxy<IShellTerminalServer>;
|
|
65
|
+
|
|
66
|
+
/*---------------------------------------------------------------------------------------------
|
|
67
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
68
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
69
|
+
*--------------------------------------------------------------------------------------------*/
|
|
70
|
+
// some code copied and modified from https://github.com/microsoft/vscode/blob/1.49.0/src/vs/workbench/contrib/terminal/common/environmentVariable.ts
|
|
71
|
+
|
|
72
|
+
export const NO_ROOT_URI = '<none>';
|
|
73
|
+
|
|
74
|
+
export interface EnvironmentVariableCollection {
|
|
75
|
+
readonly variableMutators: ReadonlyMap<string, EnvironmentVariableMutator>;
|
|
76
|
+
readonly description: string | MarkdownString | undefined;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface EnvironmentVariableCollectionWithPersistence extends EnvironmentVariableCollection {
|
|
80
|
+
readonly persistent: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export enum EnvironmentVariableMutatorType {
|
|
84
|
+
Replace = 1,
|
|
85
|
+
Append = 2,
|
|
86
|
+
Prepend = 3
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface EnvironmentVariableMutatorOptions {
|
|
90
|
+
applyAtProcessCreation?: boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface EnvironmentVariableMutator {
|
|
94
|
+
readonly value: string;
|
|
95
|
+
readonly type: EnvironmentVariableMutatorType;
|
|
96
|
+
readonly options: EnvironmentVariableMutatorOptions;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface SerializableEnvironmentVariableCollection {
|
|
100
|
+
readonly description: string | MarkdownString | undefined;
|
|
101
|
+
readonly mutators: [string, EnvironmentVariableMutator][]
|
|
102
|
+
};
|
|
103
|
+
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 Ericsson 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 { interfaces } from '@theia/core/shared/inversify';
|
|
18
|
-
import { ILogger } from '@theia/core';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Create the bindings common to node and browser.
|
|
22
|
-
*
|
|
23
|
-
* @param bind The bind function from inversify.
|
|
24
|
-
*/
|
|
25
|
-
export function createCommonBindings(bind: interfaces.Bind): void {
|
|
26
|
-
bind(ILogger).toDynamicValue(ctx => {
|
|
27
|
-
const logger = ctx.container.get<ILogger>(ILogger);
|
|
28
|
-
return logger.child('terminal');
|
|
29
|
-
}).inSingletonScope().whenTargetNamed('terminal');
|
|
30
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2018 Ericsson 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 { interfaces } from '@theia/core/shared/inversify';
|
|
18
|
+
import { ILogger } from '@theia/core';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Create the bindings common to node and browser.
|
|
22
|
+
*
|
|
23
|
+
* @param bind The bind function from inversify.
|
|
24
|
+
*/
|
|
25
|
+
export function createCommonBindings(bind: interfaces.Bind): void {
|
|
26
|
+
bind(ILogger).toDynamicValue(ctx => {
|
|
27
|
+
const logger = ctx.container.get<ILogger>(ILogger);
|
|
28
|
+
return logger.child('terminal');
|
|
29
|
+
}).inSingletonScope().whenTargetNamed('terminal');
|
|
30
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2017 Ericsson 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 { IBaseTerminalServer, IBaseTerminalServerOptions } from './base-terminal-protocol';
|
|
18
|
-
|
|
19
|
-
export const ITerminalServer = Symbol('ITerminalServer');
|
|
20
|
-
|
|
21
|
-
export const terminalPath = '/services/terminal';
|
|
22
|
-
export const terminalsPath = '/services/terminals';
|
|
23
|
-
|
|
24
|
-
export interface ITerminalServer extends IBaseTerminalServer {
|
|
25
|
-
create(ITerminalServerOptions: object): Promise<number>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface ITerminalServerOptions extends IBaseTerminalServerOptions {
|
|
29
|
-
command: string,
|
|
30
|
-
args?: string[],
|
|
31
|
-
options?: object
|
|
32
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 Ericsson 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 { IBaseTerminalServer, IBaseTerminalServerOptions } from './base-terminal-protocol';
|
|
18
|
+
|
|
19
|
+
export const ITerminalServer = Symbol('ITerminalServer');
|
|
20
|
+
|
|
21
|
+
export const terminalPath = '/services/terminal';
|
|
22
|
+
export const terminalsPath = '/services/terminals';
|
|
23
|
+
|
|
24
|
+
export interface ITerminalServer extends IBaseTerminalServer {
|
|
25
|
+
create(ITerminalServerOptions: object): Promise<number>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ITerminalServerOptions extends IBaseTerminalServerOptions {
|
|
29
|
+
command: string,
|
|
30
|
+
args?: string[],
|
|
31
|
+
options?: object
|
|
32
|
+
}
|