@theia/process 1.47.1 → 1.48.1
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/common/process-common-module.d.ts +3 -3
- package/lib/common/process-common-module.js +22 -22
- package/lib/common/process-manager-types.d.ts +35 -35
- package/lib/common/process-manager-types.js +23 -23
- package/lib/common/shell-command-builder.d.ts +49 -49
- package/lib/common/shell-command-builder.js +169 -169
- package/lib/common/shell-command-builder.slow-spec.d.ts +9 -9
- package/lib/common/shell-command-builder.slow-spec.js +404 -404
- package/lib/common/shell-quoting.d.ts +91 -91
- package/lib/common/shell-quoting.js +145 -145
- package/lib/common/shell-quoting.spec.d.ts +1 -1
- package/lib/common/shell-quoting.spec.js +170 -170
- package/lib/node/dev-null-stream.d.ts +17 -17
- package/lib/node/dev-null-stream.js +41 -41
- package/lib/node/index.d.ts +6 -6
- package/lib/node/index.js +24 -24
- package/lib/node/multi-ring-buffer.d.ts +68 -68
- package/lib/node/multi-ring-buffer.js +299 -299
- package/lib/node/multi-ring-buffer.spec.d.ts +1 -1
- package/lib/node/multi-ring-buffer.spec.js +422 -422
- package/lib/node/process-backend-module.d.ts +3 -3
- package/lib/node/process-backend-module.js +56 -56
- package/lib/node/process-manager.d.ts +33 -33
- package/lib/node/process-manager.js +102 -102
- package/lib/node/process.d.ts +95 -95
- package/lib/node/process.js +142 -142
- package/lib/node/pseudo-pty.d.ts +22 -22
- package/lib/node/pseudo-pty.js +38 -38
- package/lib/node/raw-process.d.ts +45 -45
- package/lib/node/raw-process.js +104 -104
- package/lib/node/raw-process.spec.d.ts +1 -1
- package/lib/node/raw-process.spec.js +164 -164
- package/lib/node/task-terminal-process.d.ts +10 -10
- package/lib/node/task-terminal-process.js +42 -42
- package/lib/node/terminal-process.d.ts +60 -60
- package/lib/node/terminal-process.js +248 -248
- package/lib/node/terminal-process.spec.d.ts +1 -1
- package/lib/node/terminal-process.spec.js +103 -103
- package/lib/node/test/process-test-container.d.ts +2 -2
- package/lib/node/test/process-test-container.js +28 -28
- package/lib/node/utils.d.ts +16 -16
- package/lib/node/utils.js +77 -77
- package/package.json +4 -4
- package/src/common/process-common-module.ts +22 -22
- package/src/common/process-manager-types.ts +58 -58
- package/src/common/shell-command-builder.slow-spec.ts +486 -486
- package/src/common/shell-command-builder.ts +187 -187
- package/src/common/shell-quoting.spec.ts +176 -176
- package/src/common/shell-quoting.ts +236 -236
- package/src/common/tests/$weird(),file=name.js +1 -1
- package/src/common/tests/white space.js +1 -1
- package/src/node/dev-null-stream.ts +47 -47
- package/src/node/index.ts +22 -22
- package/src/node/multi-ring-buffer.spec.ts +486 -486
- package/src/node/multi-ring-buffer.ts +348 -348
- package/src/node/process-backend-module.ts +67 -67
- package/src/node/process-manager.ts +107 -107
- package/src/node/process.ts +207 -207
- package/src/node/pseudo-pty.ts +54 -54
- package/src/node/raw-process.spec.ts +199 -199
- package/src/node/raw-process.ts +156 -156
- package/src/node/string-argv.d.ts +21 -21
- package/src/node/task-terminal-process.ts +41 -41
- package/src/node/terminal-process.spec.ts +121 -121
- package/src/node/terminal-process.ts +290 -290
- package/src/node/test/process-fork-test.js +22 -22
- package/src/node/test/process-test-container.ts +27 -27
- package/src/node/utils.ts +79 -79
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company 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.TaskTerminalProcess = exports.TaskTerminalProcessFactory = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const terminal_process_1 = require("./terminal-process");
|
|
22
|
-
exports.TaskTerminalProcessFactory = Symbol('TaskTerminalProcessFactory');
|
|
23
|
-
let TaskTerminalProcess = class TaskTerminalProcess extends terminal_process_1.TerminalProcess {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(...arguments);
|
|
26
|
-
this.exited = false;
|
|
27
|
-
this.attachmentAttempted = false;
|
|
28
|
-
}
|
|
29
|
-
onTerminalExit(code, signal) {
|
|
30
|
-
this.emitOnExit(code, signal);
|
|
31
|
-
this.exited = true;
|
|
32
|
-
// Unregister process only if task terminal already attached (or failed attach),
|
|
33
|
-
// Fixes https://github.com/eclipse-theia/theia/issues/2961
|
|
34
|
-
if (this.attachmentAttempted) {
|
|
35
|
-
this.unregisterProcess();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
TaskTerminalProcess = (0, tslib_1.__decorate)([
|
|
40
|
-
(0, inversify_1.injectable)()
|
|
41
|
-
], TaskTerminalProcess);
|
|
42
|
-
exports.TaskTerminalProcess = TaskTerminalProcess;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company 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.TaskTerminalProcess = exports.TaskTerminalProcessFactory = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const terminal_process_1 = require("./terminal-process");
|
|
22
|
+
exports.TaskTerminalProcessFactory = Symbol('TaskTerminalProcessFactory');
|
|
23
|
+
let TaskTerminalProcess = class TaskTerminalProcess extends terminal_process_1.TerminalProcess {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.exited = false;
|
|
27
|
+
this.attachmentAttempted = false;
|
|
28
|
+
}
|
|
29
|
+
onTerminalExit(code, signal) {
|
|
30
|
+
this.emitOnExit(code, signal);
|
|
31
|
+
this.exited = true;
|
|
32
|
+
// Unregister process only if task terminal already attached (or failed attach),
|
|
33
|
+
// Fixes https://github.com/eclipse-theia/theia/issues/2961
|
|
34
|
+
if (this.attachmentAttempted) {
|
|
35
|
+
this.unregisterProcess();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
TaskTerminalProcess = (0, tslib_1.__decorate)([
|
|
40
|
+
(0, inversify_1.injectable)()
|
|
41
|
+
], TaskTerminalProcess);
|
|
42
|
+
exports.TaskTerminalProcess = TaskTerminalProcess;
|
|
43
43
|
//# sourceMappingURL=task-terminal-process.js.map
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ILogger } from '@theia/core/lib/common';
|
|
3
|
-
import { Process, ProcessOptions } from './process';
|
|
4
|
-
import { ProcessManager } from './process-manager';
|
|
5
|
-
import { IPty } from 'node-pty';
|
|
6
|
-
import { MultiRingBuffer, MultiRingBufferReadableStream } from './multi-ring-buffer';
|
|
7
|
-
import { DevNullStream } from './dev-null-stream';
|
|
8
|
-
import { Writable } from 'stream';
|
|
9
|
-
export declare const TerminalProcessOptions: unique symbol;
|
|
10
|
-
export interface TerminalProcessOptions extends ProcessOptions {
|
|
11
|
-
/**
|
|
12
|
-
* Windows only. Allow passing complex command lines already escaped for CommandLineToArgvW.
|
|
13
|
-
*/
|
|
14
|
-
commandLine?: string;
|
|
15
|
-
isPseudo?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare const TerminalProcessFactory: unique symbol;
|
|
18
|
-
export interface TerminalProcessFactory {
|
|
19
|
-
(options: TerminalProcessOptions): TerminalProcess;
|
|
20
|
-
}
|
|
21
|
-
export declare enum NodePtyErrors {
|
|
22
|
-
EACCES = "Permission denied",
|
|
23
|
-
ENOENT = "No such file or directory"
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Run arbitrary processes inside pseudo-terminals (PTY).
|
|
27
|
-
*
|
|
28
|
-
* Note: a PTY is not a shell process (bash/pwsh/cmd...)
|
|
29
|
-
*/
|
|
30
|
-
export declare class TerminalProcess extends Process {
|
|
31
|
-
protected readonly options: TerminalProcessOptions;
|
|
32
|
-
protected readonly ringBuffer: MultiRingBuffer;
|
|
33
|
-
protected readonly terminal: IPty | undefined;
|
|
34
|
-
private _delayedResizer;
|
|
35
|
-
private _exitCode;
|
|
36
|
-
readonly outputStream: MultiRingBufferReadableStream;
|
|
37
|
-
readonly errorStream: DevNullStream;
|
|
38
|
-
readonly inputStream: Writable;
|
|
39
|
-
constructor(// eslint-disable-next-line @typescript-eslint/indent
|
|
40
|
-
options: TerminalProcessOptions, processManager: ProcessManager, ringBuffer: MultiRingBuffer, logger: ILogger);
|
|
41
|
-
/**
|
|
42
|
-
* Helper for the constructor to attempt to create the pseudo-terminal encapsulating the shell process.
|
|
43
|
-
*
|
|
44
|
-
* @param command the shell command to launch
|
|
45
|
-
* @param options options for the shell process
|
|
46
|
-
* @param ringBuffer a ring buffer in which to collect terminal output
|
|
47
|
-
* @returns the terminal PTY and a stream by which it may be sent input
|
|
48
|
-
*/
|
|
49
|
-
private createPseudoTerminal;
|
|
50
|
-
createOutputStream(): MultiRingBufferReadableStream;
|
|
51
|
-
get pid(): number;
|
|
52
|
-
get executable(): string;
|
|
53
|
-
get arguments(): string[];
|
|
54
|
-
protected onTerminalExit(code: number | undefined, signal: string | undefined): void;
|
|
55
|
-
unregisterProcess(): void;
|
|
56
|
-
kill(signal?: string): void;
|
|
57
|
-
resize(cols: number, rows: number): void;
|
|
58
|
-
write(data: string): void;
|
|
59
|
-
protected checkTerminal(): void | never;
|
|
60
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ILogger } from '@theia/core/lib/common';
|
|
3
|
+
import { Process, ProcessOptions } from './process';
|
|
4
|
+
import { ProcessManager } from './process-manager';
|
|
5
|
+
import { IPty } from 'node-pty';
|
|
6
|
+
import { MultiRingBuffer, MultiRingBufferReadableStream } from './multi-ring-buffer';
|
|
7
|
+
import { DevNullStream } from './dev-null-stream';
|
|
8
|
+
import { Writable } from 'stream';
|
|
9
|
+
export declare const TerminalProcessOptions: unique symbol;
|
|
10
|
+
export interface TerminalProcessOptions extends ProcessOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Windows only. Allow passing complex command lines already escaped for CommandLineToArgvW.
|
|
13
|
+
*/
|
|
14
|
+
commandLine?: string;
|
|
15
|
+
isPseudo?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const TerminalProcessFactory: unique symbol;
|
|
18
|
+
export interface TerminalProcessFactory {
|
|
19
|
+
(options: TerminalProcessOptions): TerminalProcess;
|
|
20
|
+
}
|
|
21
|
+
export declare enum NodePtyErrors {
|
|
22
|
+
EACCES = "Permission denied",
|
|
23
|
+
ENOENT = "No such file or directory"
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Run arbitrary processes inside pseudo-terminals (PTY).
|
|
27
|
+
*
|
|
28
|
+
* Note: a PTY is not a shell process (bash/pwsh/cmd...)
|
|
29
|
+
*/
|
|
30
|
+
export declare class TerminalProcess extends Process {
|
|
31
|
+
protected readonly options: TerminalProcessOptions;
|
|
32
|
+
protected readonly ringBuffer: MultiRingBuffer;
|
|
33
|
+
protected readonly terminal: IPty | undefined;
|
|
34
|
+
private _delayedResizer;
|
|
35
|
+
private _exitCode;
|
|
36
|
+
readonly outputStream: MultiRingBufferReadableStream;
|
|
37
|
+
readonly errorStream: DevNullStream;
|
|
38
|
+
readonly inputStream: Writable;
|
|
39
|
+
constructor(// eslint-disable-next-line @typescript-eslint/indent
|
|
40
|
+
options: TerminalProcessOptions, processManager: ProcessManager, ringBuffer: MultiRingBuffer, logger: ILogger);
|
|
41
|
+
/**
|
|
42
|
+
* Helper for the constructor to attempt to create the pseudo-terminal encapsulating the shell process.
|
|
43
|
+
*
|
|
44
|
+
* @param command the shell command to launch
|
|
45
|
+
* @param options options for the shell process
|
|
46
|
+
* @param ringBuffer a ring buffer in which to collect terminal output
|
|
47
|
+
* @returns the terminal PTY and a stream by which it may be sent input
|
|
48
|
+
*/
|
|
49
|
+
private createPseudoTerminal;
|
|
50
|
+
createOutputStream(): MultiRingBufferReadableStream;
|
|
51
|
+
get pid(): number;
|
|
52
|
+
get executable(): string;
|
|
53
|
+
get arguments(): string[];
|
|
54
|
+
protected onTerminalExit(code: number | undefined, signal: string | undefined): void;
|
|
55
|
+
unregisterProcess(): void;
|
|
56
|
+
kill(signal?: string): void;
|
|
57
|
+
resize(cols: number, rows: number): void;
|
|
58
|
+
write(data: string): void;
|
|
59
|
+
protected checkTerminal(): void | never;
|
|
60
|
+
}
|
|
61
61
|
//# sourceMappingURL=terminal-process.d.ts.map
|