@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,44 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2022 Ericsson 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
|
-
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
19
|
-
const chai_1 = require("chai");
|
|
20
|
-
const buffering_stream_1 = require("./buffering-stream");
|
|
21
|
-
describe('BufferringStream', () => {
|
|
22
|
-
it('should emit whatever data was buffered before the timeout', async () => {
|
|
23
|
-
const buffer = new buffering_stream_1.BufferBufferingStream({ emitInterval: 1000 });
|
|
24
|
-
const chunkPromise = waitForChunk(buffer);
|
|
25
|
-
buffer.push(Buffer.from([0]));
|
|
26
|
-
await (0, promise_util_1.wait)(100);
|
|
27
|
-
buffer.push(Buffer.from([1]));
|
|
28
|
-
await (0, promise_util_1.wait)(100);
|
|
29
|
-
buffer.push(Buffer.from([2, 3, 4]));
|
|
30
|
-
const chunk = await chunkPromise;
|
|
31
|
-
(0, chai_1.expect)(chunk).deep.eq(Buffer.from([0, 1, 2, 3, 4]));
|
|
32
|
-
});
|
|
33
|
-
it('should not emit chunks bigger than maxChunkSize', async () => {
|
|
34
|
-
const buffer = new buffering_stream_1.BufferBufferingStream({ maxChunkSize: 2 });
|
|
35
|
-
buffer.push(Buffer.from([0, 1, 2, 3, 4, 5]));
|
|
36
|
-
(0, chai_1.expect)(await waitForChunk(buffer)).deep.eq(Buffer.from([0, 1]));
|
|
37
|
-
(0, chai_1.expect)(await waitForChunk(buffer)).deep.eq(Buffer.from([2, 3]));
|
|
38
|
-
(0, chai_1.expect)(await waitForChunk(buffer)).deep.eq(Buffer.from([4, 5]));
|
|
39
|
-
});
|
|
40
|
-
function waitForChunk(buffer) {
|
|
41
|
-
return new Promise(resolve => buffer.onData(resolve));
|
|
42
|
-
}
|
|
43
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 Ericsson 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
|
+
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
19
|
+
const chai_1 = require("chai");
|
|
20
|
+
const buffering_stream_1 = require("./buffering-stream");
|
|
21
|
+
describe('BufferringStream', () => {
|
|
22
|
+
it('should emit whatever data was buffered before the timeout', async () => {
|
|
23
|
+
const buffer = new buffering_stream_1.BufferBufferingStream({ emitInterval: 1000 });
|
|
24
|
+
const chunkPromise = waitForChunk(buffer);
|
|
25
|
+
buffer.push(Buffer.from([0]));
|
|
26
|
+
await (0, promise_util_1.wait)(100);
|
|
27
|
+
buffer.push(Buffer.from([1]));
|
|
28
|
+
await (0, promise_util_1.wait)(100);
|
|
29
|
+
buffer.push(Buffer.from([2, 3, 4]));
|
|
30
|
+
const chunk = await chunkPromise;
|
|
31
|
+
(0, chai_1.expect)(chunk).deep.eq(Buffer.from([0, 1, 2, 3, 4]));
|
|
32
|
+
});
|
|
33
|
+
it('should not emit chunks bigger than maxChunkSize', async () => {
|
|
34
|
+
const buffer = new buffering_stream_1.BufferBufferingStream({ maxChunkSize: 2 });
|
|
35
|
+
buffer.push(Buffer.from([0, 1, 2, 3, 4, 5]));
|
|
36
|
+
(0, chai_1.expect)(await waitForChunk(buffer)).deep.eq(Buffer.from([0, 1]));
|
|
37
|
+
(0, chai_1.expect)(await waitForChunk(buffer)).deep.eq(Buffer.from([2, 3]));
|
|
38
|
+
(0, chai_1.expect)(await waitForChunk(buffer)).deep.eq(Buffer.from([4, 5]));
|
|
39
|
+
});
|
|
40
|
+
function waitForChunk(buffer) {
|
|
41
|
+
return new Promise(resolve => buffer.onData(resolve));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
44
|
//# sourceMappingURL=buffering-stream.spec.js.map
|
package/lib/node/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './terminal-backend-module';
|
|
1
|
+
export * from './terminal-backend-module';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/node/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017 TypeFox 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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
__exportStar(require("./terminal-backend-module"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2017 TypeFox 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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
__exportStar(require("./terminal-backend-module"), exports);
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { ILogger } from '@theia/core/lib/common/logger';
|
|
2
|
-
import { TerminalProcess, ProcessManager, MultiRingBuffer } from '@theia/process/lib/node';
|
|
3
|
-
import { EnvironmentUtils } from '@theia/core/lib/node/environment-utils';
|
|
4
|
-
export declare const ShellProcessFactory: unique symbol;
|
|
5
|
-
export declare type ShellProcessFactory = (options: ShellProcessOptions) => ShellProcess;
|
|
6
|
-
export declare const ShellProcessOptions: unique symbol;
|
|
7
|
-
export interface ShellProcessOptions {
|
|
8
|
-
shell?: string;
|
|
9
|
-
args?: string[] | string;
|
|
10
|
-
rootURI?: string;
|
|
11
|
-
cols?: number;
|
|
12
|
-
rows?: number;
|
|
13
|
-
env?: {
|
|
14
|
-
[key: string]: string | null;
|
|
15
|
-
};
|
|
16
|
-
strictEnv?: boolean;
|
|
17
|
-
isPseudo?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare function getRootPath(rootURI?: string): string;
|
|
20
|
-
export declare class ShellProcess extends TerminalProcess {
|
|
21
|
-
protected static defaultCols: number;
|
|
22
|
-
protected static defaultRows: number;
|
|
23
|
-
constructor(// eslint-disable-next-line @typescript-eslint/indent
|
|
24
|
-
options: ShellProcessOptions, processManager: ProcessManager, ringBuffer: MultiRingBuffer, logger: ILogger, environmentUtils: EnvironmentUtils);
|
|
25
|
-
static getShellExecutablePath(): string;
|
|
26
|
-
static getShellExecutableArgs(): string[];
|
|
27
|
-
}
|
|
1
|
+
import { ILogger } from '@theia/core/lib/common/logger';
|
|
2
|
+
import { TerminalProcess, ProcessManager, MultiRingBuffer } from '@theia/process/lib/node';
|
|
3
|
+
import { EnvironmentUtils } from '@theia/core/lib/node/environment-utils';
|
|
4
|
+
export declare const ShellProcessFactory: unique symbol;
|
|
5
|
+
export declare type ShellProcessFactory = (options: ShellProcessOptions) => ShellProcess;
|
|
6
|
+
export declare const ShellProcessOptions: unique symbol;
|
|
7
|
+
export interface ShellProcessOptions {
|
|
8
|
+
shell?: string;
|
|
9
|
+
args?: string[] | string;
|
|
10
|
+
rootURI?: string;
|
|
11
|
+
cols?: number;
|
|
12
|
+
rows?: number;
|
|
13
|
+
env?: {
|
|
14
|
+
[key: string]: string | null;
|
|
15
|
+
};
|
|
16
|
+
strictEnv?: boolean;
|
|
17
|
+
isPseudo?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function getRootPath(rootURI?: string): string;
|
|
20
|
+
export declare class ShellProcess extends TerminalProcess {
|
|
21
|
+
protected static defaultCols: number;
|
|
22
|
+
protected static defaultRows: number;
|
|
23
|
+
constructor(// eslint-disable-next-line @typescript-eslint/indent
|
|
24
|
+
options: ShellProcessOptions, processManager: ProcessManager, ringBuffer: MultiRingBuffer, logger: ILogger, environmentUtils: EnvironmentUtils);
|
|
25
|
+
static getShellExecutablePath(): string;
|
|
26
|
+
static getShellExecutableArgs(): string[];
|
|
27
|
+
}
|
|
28
28
|
//# sourceMappingURL=shell-process.d.ts.map
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017 Ericsson 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
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
-
};
|
|
29
|
-
var ShellProcess_1;
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.ShellProcess = exports.getRootPath = exports.ShellProcessOptions = exports.ShellProcessFactory = void 0;
|
|
32
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
-
const os = require("os");
|
|
34
|
-
const logger_1 = require("@theia/core/lib/common/logger");
|
|
35
|
-
const node_1 = require("@theia/process/lib/node");
|
|
36
|
-
const common_1 = require("@theia/core/lib/common");
|
|
37
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
38
|
-
const file_uri_1 = require("@theia/core/lib/
|
|
39
|
-
const environment_utils_1 = require("@theia/core/lib/node/environment-utils");
|
|
40
|
-
const utils_1 = require("@theia/process/lib/node/utils");
|
|
41
|
-
exports.ShellProcessFactory = Symbol('ShellProcessFactory');
|
|
42
|
-
exports.ShellProcessOptions = Symbol('ShellProcessOptions');
|
|
43
|
-
function getRootPath(rootURI) {
|
|
44
|
-
if (rootURI) {
|
|
45
|
-
const uri = new uri_1.default(rootURI);
|
|
46
|
-
return file_uri_1.FileUri.fsPath(uri);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
return os.homedir();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.getRootPath = getRootPath;
|
|
53
|
-
let ShellProcess = ShellProcess_1 = class ShellProcess extends node_1.TerminalProcess {
|
|
54
|
-
constructor(// eslint-disable-next-line @typescript-eslint/indent
|
|
55
|
-
options, processManager, ringBuffer, logger, environmentUtils) {
|
|
56
|
-
super({
|
|
57
|
-
command: options.shell || ShellProcess_1.getShellExecutablePath(),
|
|
58
|
-
args: options.args || ShellProcess_1.getShellExecutableArgs(),
|
|
59
|
-
options: {
|
|
60
|
-
name: 'xterm-color',
|
|
61
|
-
cols: options.cols || ShellProcess_1.defaultCols,
|
|
62
|
-
rows: options.rows || ShellProcess_1.defaultRows,
|
|
63
|
-
cwd: getRootPath(options.rootURI),
|
|
64
|
-
env: options.strictEnv !== true ? environmentUtils.mergeProcessEnv(options.env) : options.env,
|
|
65
|
-
},
|
|
66
|
-
isPseudo: options.isPseudo,
|
|
67
|
-
}, processManager, ringBuffer, logger);
|
|
68
|
-
}
|
|
69
|
-
static getShellExecutablePath() {
|
|
70
|
-
const shell = process.env.THEIA_SHELL;
|
|
71
|
-
if (shell) {
|
|
72
|
-
return shell;
|
|
73
|
-
}
|
|
74
|
-
if (common_1.isWindows) {
|
|
75
|
-
return 'cmd.exe';
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
return process.env.SHELL;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
static getShellExecutableArgs() {
|
|
82
|
-
const args = process.env.THEIA_SHELL_ARGS;
|
|
83
|
-
if (args) {
|
|
84
|
-
return (0, utils_1.parseArgs)(args);
|
|
85
|
-
}
|
|
86
|
-
if (common_1.isOSX) {
|
|
87
|
-
return ['-l'];
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
return [];
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
ShellProcess.defaultCols = 80;
|
|
95
|
-
ShellProcess.defaultRows = 24;
|
|
96
|
-
ShellProcess = ShellProcess_1 = __decorate([
|
|
97
|
-
(0, inversify_1.injectable)(),
|
|
98
|
-
__param(0, (0, inversify_1.inject)(exports.ShellProcessOptions)),
|
|
99
|
-
__param(1, (0, inversify_1.inject)(node_1.ProcessManager)),
|
|
100
|
-
__param(2, (0, inversify_1.inject)(node_1.MultiRingBuffer)),
|
|
101
|
-
__param(3, (0, inversify_1.inject)(logger_1.ILogger)),
|
|
102
|
-
__param(3, (0, inversify_1.named)('terminal')),
|
|
103
|
-
__param(4, (0, inversify_1.inject)(environment_utils_1.EnvironmentUtils)),
|
|
104
|
-
__metadata("design:paramtypes", [Object, node_1.ProcessManager,
|
|
105
|
-
node_1.MultiRingBuffer, Object, environment_utils_1.EnvironmentUtils])
|
|
106
|
-
], ShellProcess);
|
|
107
|
-
exports.ShellProcess = ShellProcess;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2017 Ericsson 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
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
+
};
|
|
29
|
+
var ShellProcess_1;
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.ShellProcess = exports.getRootPath = exports.ShellProcessOptions = exports.ShellProcessFactory = void 0;
|
|
32
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
+
const os = require("os");
|
|
34
|
+
const logger_1 = require("@theia/core/lib/common/logger");
|
|
35
|
+
const node_1 = require("@theia/process/lib/node");
|
|
36
|
+
const common_1 = require("@theia/core/lib/common");
|
|
37
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
38
|
+
const file_uri_1 = require("@theia/core/lib/common/file-uri");
|
|
39
|
+
const environment_utils_1 = require("@theia/core/lib/node/environment-utils");
|
|
40
|
+
const utils_1 = require("@theia/process/lib/node/utils");
|
|
41
|
+
exports.ShellProcessFactory = Symbol('ShellProcessFactory');
|
|
42
|
+
exports.ShellProcessOptions = Symbol('ShellProcessOptions');
|
|
43
|
+
function getRootPath(rootURI) {
|
|
44
|
+
if (rootURI) {
|
|
45
|
+
const uri = new uri_1.default(rootURI);
|
|
46
|
+
return file_uri_1.FileUri.fsPath(uri);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return os.homedir();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.getRootPath = getRootPath;
|
|
53
|
+
let ShellProcess = ShellProcess_1 = class ShellProcess extends node_1.TerminalProcess {
|
|
54
|
+
constructor(// eslint-disable-next-line @typescript-eslint/indent
|
|
55
|
+
options, processManager, ringBuffer, logger, environmentUtils) {
|
|
56
|
+
super({
|
|
57
|
+
command: options.shell || ShellProcess_1.getShellExecutablePath(),
|
|
58
|
+
args: options.args || ShellProcess_1.getShellExecutableArgs(),
|
|
59
|
+
options: {
|
|
60
|
+
name: 'xterm-color',
|
|
61
|
+
cols: options.cols || ShellProcess_1.defaultCols,
|
|
62
|
+
rows: options.rows || ShellProcess_1.defaultRows,
|
|
63
|
+
cwd: getRootPath(options.rootURI),
|
|
64
|
+
env: options.strictEnv !== true ? environmentUtils.mergeProcessEnv(options.env) : options.env,
|
|
65
|
+
},
|
|
66
|
+
isPseudo: options.isPseudo,
|
|
67
|
+
}, processManager, ringBuffer, logger);
|
|
68
|
+
}
|
|
69
|
+
static getShellExecutablePath() {
|
|
70
|
+
const shell = process.env.THEIA_SHELL;
|
|
71
|
+
if (shell) {
|
|
72
|
+
return shell;
|
|
73
|
+
}
|
|
74
|
+
if (common_1.isWindows) {
|
|
75
|
+
return 'cmd.exe';
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return process.env.SHELL;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
static getShellExecutableArgs() {
|
|
82
|
+
const args = process.env.THEIA_SHELL_ARGS;
|
|
83
|
+
if (args) {
|
|
84
|
+
return (0, utils_1.parseArgs)(args);
|
|
85
|
+
}
|
|
86
|
+
if (common_1.isOSX) {
|
|
87
|
+
return ['-l'];
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
ShellProcess.defaultCols = 80;
|
|
95
|
+
ShellProcess.defaultRows = 24;
|
|
96
|
+
ShellProcess = ShellProcess_1 = __decorate([
|
|
97
|
+
(0, inversify_1.injectable)(),
|
|
98
|
+
__param(0, (0, inversify_1.inject)(exports.ShellProcessOptions)),
|
|
99
|
+
__param(1, (0, inversify_1.inject)(node_1.ProcessManager)),
|
|
100
|
+
__param(2, (0, inversify_1.inject)(node_1.MultiRingBuffer)),
|
|
101
|
+
__param(3, (0, inversify_1.inject)(logger_1.ILogger)),
|
|
102
|
+
__param(3, (0, inversify_1.named)('terminal')),
|
|
103
|
+
__param(4, (0, inversify_1.inject)(environment_utils_1.EnvironmentUtils)),
|
|
104
|
+
__metadata("design:paramtypes", [Object, node_1.ProcessManager,
|
|
105
|
+
node_1.MultiRingBuffer, Object, environment_utils_1.EnvironmentUtils])
|
|
106
|
+
], ShellProcess);
|
|
107
|
+
exports.ShellProcess = ShellProcess;
|
|
108
108
|
//# sourceMappingURL=shell-process.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-process.js","sourceRoot":"","sources":["../../src/node/shell-process.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;;;;;;;;;;;;AAEhF,4DAAyE;AACzE,yBAAyB;AACzB,0DAAwD;AACxD,kDAAmH;AACnH,mDAA0D;AAC1D,oDAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"shell-process.js","sourceRoot":"","sources":["../../src/node/shell-process.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { ILogger } from '@theia/core/lib/common/logger';
|
|
2
|
-
import { EnvironmentUtils } from '@theia/core/lib/node/environment-utils';
|
|
3
|
-
import { BaseTerminalServer } from './base-terminal-server';
|
|
4
|
-
import { ShellProcessFactory } from './shell-process';
|
|
5
|
-
import { ProcessManager } from '@theia/process/lib/node';
|
|
6
|
-
import { EnvironmentVariableCollectionWithPersistence, SerializableEnvironmentVariableCollection, IShellTerminalServer, IShellTerminalServerOptions } from '../common/shell-terminal-protocol';
|
|
7
|
-
import { URI } from '@theia/core';
|
|
8
|
-
import { MultiKeyMap } from '@theia/core/lib/common/collections';
|
|
9
|
-
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string';
|
|
10
|
-
export declare class ShellTerminalServer extends BaseTerminalServer implements IShellTerminalServer {
|
|
11
|
-
protected readonly shellFactory: ShellProcessFactory;
|
|
12
|
-
protected environmentUtils: EnvironmentUtils;
|
|
13
|
-
readonly collections: MultiKeyMap<string, EnvironmentVariableCollectionWithPersistence>;
|
|
14
|
-
constructor(shellFactory: ShellProcessFactory, processManager: ProcessManager, logger: ILogger);
|
|
15
|
-
create(options: IShellTerminalServerOptions): Promise<number>;
|
|
16
|
-
private spawnAsPromised;
|
|
17
|
-
hasChildProcesses(processId: number | undefined): Promise<boolean>;
|
|
18
|
-
applyToProcessEnvironment(cwdUri: URI, env: {
|
|
19
|
-
[key: string]: string | null;
|
|
20
|
-
}): void;
|
|
21
|
-
matchesRootUri(cwdUri: URI, rootUri: string): boolean;
|
|
22
|
-
setCollection(extensionIdentifier: string, baseUri: string, persistent: boolean, collection: SerializableEnvironmentVariableCollection): void;
|
|
23
|
-
private doSetCollection;
|
|
24
|
-
restorePersisted(jsonValue: string): void;
|
|
25
|
-
deleteCollection(extensionIdentifier: string): void;
|
|
26
|
-
private updateCollections;
|
|
27
|
-
protected persistCollections(): void;
|
|
28
|
-
getEnvVarCollectionDescriptionsByExtension(id: number): Promise<Map<string, (string | MarkdownString | undefined)[]>>;
|
|
29
|
-
getEnvVarCollections(): Promise<[string, string, boolean, SerializableEnvironmentVariableCollection][]>;
|
|
30
|
-
}
|
|
1
|
+
import { ILogger } from '@theia/core/lib/common/logger';
|
|
2
|
+
import { EnvironmentUtils } from '@theia/core/lib/node/environment-utils';
|
|
3
|
+
import { BaseTerminalServer } from './base-terminal-server';
|
|
4
|
+
import { ShellProcessFactory } from './shell-process';
|
|
5
|
+
import { ProcessManager } from '@theia/process/lib/node';
|
|
6
|
+
import { EnvironmentVariableCollectionWithPersistence, SerializableEnvironmentVariableCollection, IShellTerminalServer, IShellTerminalServerOptions } from '../common/shell-terminal-protocol';
|
|
7
|
+
import { URI } from '@theia/core';
|
|
8
|
+
import { MultiKeyMap } from '@theia/core/lib/common/collections';
|
|
9
|
+
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string';
|
|
10
|
+
export declare class ShellTerminalServer extends BaseTerminalServer implements IShellTerminalServer {
|
|
11
|
+
protected readonly shellFactory: ShellProcessFactory;
|
|
12
|
+
protected environmentUtils: EnvironmentUtils;
|
|
13
|
+
readonly collections: MultiKeyMap<string, EnvironmentVariableCollectionWithPersistence>;
|
|
14
|
+
constructor(shellFactory: ShellProcessFactory, processManager: ProcessManager, logger: ILogger);
|
|
15
|
+
create(options: IShellTerminalServerOptions): Promise<number>;
|
|
16
|
+
private spawnAsPromised;
|
|
17
|
+
hasChildProcesses(processId: number | undefined): Promise<boolean>;
|
|
18
|
+
applyToProcessEnvironment(cwdUri: URI, env: {
|
|
19
|
+
[key: string]: string | null;
|
|
20
|
+
}): void;
|
|
21
|
+
matchesRootUri(cwdUri: URI, rootUri: string): boolean;
|
|
22
|
+
setCollection(extensionIdentifier: string, baseUri: string, persistent: boolean, collection: SerializableEnvironmentVariableCollection): void;
|
|
23
|
+
private doSetCollection;
|
|
24
|
+
restorePersisted(jsonValue: string): void;
|
|
25
|
+
deleteCollection(extensionIdentifier: string): void;
|
|
26
|
+
private updateCollections;
|
|
27
|
+
protected persistCollections(): void;
|
|
28
|
+
getEnvVarCollectionDescriptionsByExtension(id: number): Promise<Map<string, (string | MarkdownString | undefined)[]>>;
|
|
29
|
+
getEnvVarCollections(): Promise<[string, string, boolean, SerializableEnvironmentVariableCollection][]>;
|
|
30
|
+
}
|
|
31
31
|
//# sourceMappingURL=shell-terminal-server.d.ts.map
|