@theia/process 1.48.0 → 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
package/lib/node/process.js
CHANGED
|
@@ -1,143 +1,143 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.Process = exports.ProcessType = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const common_1 = require("@theia/core/lib/common");
|
|
22
|
-
const node_1 = require("@theia/core/lib/node");
|
|
23
|
-
const core_1 = require("@theia/core");
|
|
24
|
-
const child_process_1 = require("child_process");
|
|
25
|
-
const fs = require("fs");
|
|
26
|
-
const process_manager_types_1 = require("../common/process-manager-types");
|
|
27
|
-
Object.defineProperty(exports, "ProcessType", { enumerable: true, get: function () { return process_manager_types_1.ProcessType; } });
|
|
28
|
-
let Process = class Process {
|
|
29
|
-
constructor(processManager, logger, type, options) {
|
|
30
|
-
this.processManager = processManager;
|
|
31
|
-
this.logger = logger;
|
|
32
|
-
this.type = type;
|
|
33
|
-
this.options = options;
|
|
34
|
-
this.startEmitter = new common_1.Emitter();
|
|
35
|
-
this.exitEmitter = new common_1.Emitter();
|
|
36
|
-
this.closeEmitter = new common_1.Emitter();
|
|
37
|
-
this.errorEmitter = new common_1.Emitter();
|
|
38
|
-
this._killed = false;
|
|
39
|
-
this.id = this.processManager.register(this);
|
|
40
|
-
this.initialCwd = options && options.options && 'cwd' in options.options && options.options['cwd'].toString() || __dirname;
|
|
41
|
-
}
|
|
42
|
-
get killed() {
|
|
43
|
-
return this._killed;
|
|
44
|
-
}
|
|
45
|
-
get onStart() {
|
|
46
|
-
return this.startEmitter.event;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Wait for the process to exit, streams can still emit data.
|
|
50
|
-
*/
|
|
51
|
-
get onExit() {
|
|
52
|
-
return this.exitEmitter.event;
|
|
53
|
-
}
|
|
54
|
-
get onError() {
|
|
55
|
-
return this.errorEmitter.event;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Waits for both process exit and for all the streams to be closed.
|
|
59
|
-
*/
|
|
60
|
-
get onClose() {
|
|
61
|
-
return this.closeEmitter.event;
|
|
62
|
-
}
|
|
63
|
-
emitOnStarted() {
|
|
64
|
-
this.startEmitter.fire({});
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Emit the onExit event for this process. Only one of code and signal
|
|
68
|
-
* should be defined.
|
|
69
|
-
*/
|
|
70
|
-
emitOnExit(code, signal) {
|
|
71
|
-
const exitEvent = { code, signal };
|
|
72
|
-
this.handleOnExit(exitEvent);
|
|
73
|
-
this.exitEmitter.fire(exitEvent);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Emit the onClose event for this process. Only one of code and signal
|
|
77
|
-
* should be defined.
|
|
78
|
-
*/
|
|
79
|
-
emitOnClose(code, signal) {
|
|
80
|
-
this.closeEmitter.fire({ code, signal });
|
|
81
|
-
}
|
|
82
|
-
handleOnExit(event) {
|
|
83
|
-
this._killed = true;
|
|
84
|
-
const signalSuffix = event.signal ? `, signal: ${event.signal}` : '';
|
|
85
|
-
const executable = this.isForkOptions(this.options) ? this.options.modulePath : this.options.command;
|
|
86
|
-
this.logger.debug(`Process ${this.pid} has exited with code ${event.code}${signalSuffix}.`, executable, this.options.args);
|
|
87
|
-
}
|
|
88
|
-
emitOnError(err) {
|
|
89
|
-
this.handleOnError(err);
|
|
90
|
-
this.errorEmitter.fire(err);
|
|
91
|
-
}
|
|
92
|
-
async emitOnErrorAsync(error) {
|
|
93
|
-
process.nextTick(this.emitOnError.bind(this), error);
|
|
94
|
-
}
|
|
95
|
-
handleOnError(error) {
|
|
96
|
-
this._killed = true;
|
|
97
|
-
this.logger.error(error);
|
|
98
|
-
}
|
|
99
|
-
isForkOptions(options) {
|
|
100
|
-
return (0, common_1.isObject)(options) && !!options.modulePath;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* @returns the current working directory as a URI (usually file:// URI)
|
|
104
|
-
*/
|
|
105
|
-
getCwdURI() {
|
|
106
|
-
if (core_1.isOSX) {
|
|
107
|
-
return new Promise(resolve => {
|
|
108
|
-
(0, child_process_1.exec)('lsof -OPln -p ' + this.pid + ' | grep cwd', (error, stdout, stderr) => {
|
|
109
|
-
if (stdout !== '') {
|
|
110
|
-
resolve(node_1.FileUri.create(stdout.substring(stdout.indexOf('/'), stdout.length - 1)).toString());
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
resolve(node_1.FileUri.create(this.initialCwd).toString());
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
else if (!core_1.isWindows) {
|
|
119
|
-
return new Promise(resolve => {
|
|
120
|
-
fs.readlink('/proc/' + this.pid + '/cwd', (err, linkedstr) => {
|
|
121
|
-
if (err || !linkedstr) {
|
|
122
|
-
resolve(node_1.FileUri.create(this.initialCwd).toString());
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
resolve(node_1.FileUri.create(linkedstr).toString());
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
return new Promise(resolve => {
|
|
132
|
-
resolve(node_1.FileUri.create(this.initialCwd).toString());
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
Process = (0, tslib_1.__decorate)([
|
|
138
|
-
(0, inversify_1.injectable)(),
|
|
139
|
-
(0, tslib_1.__param)(2, (0, inversify_1.unmanaged)()),
|
|
140
|
-
(0, tslib_1.__metadata)("design:paramtypes", [Object, Object, Number, Object])
|
|
141
|
-
], Process);
|
|
142
|
-
exports.Process = Process;
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.Process = exports.ProcessType = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const common_1 = require("@theia/core/lib/common");
|
|
22
|
+
const node_1 = require("@theia/core/lib/node");
|
|
23
|
+
const core_1 = require("@theia/core");
|
|
24
|
+
const child_process_1 = require("child_process");
|
|
25
|
+
const fs = require("fs");
|
|
26
|
+
const process_manager_types_1 = require("../common/process-manager-types");
|
|
27
|
+
Object.defineProperty(exports, "ProcessType", { enumerable: true, get: function () { return process_manager_types_1.ProcessType; } });
|
|
28
|
+
let Process = class Process {
|
|
29
|
+
constructor(processManager, logger, type, options) {
|
|
30
|
+
this.processManager = processManager;
|
|
31
|
+
this.logger = logger;
|
|
32
|
+
this.type = type;
|
|
33
|
+
this.options = options;
|
|
34
|
+
this.startEmitter = new common_1.Emitter();
|
|
35
|
+
this.exitEmitter = new common_1.Emitter();
|
|
36
|
+
this.closeEmitter = new common_1.Emitter();
|
|
37
|
+
this.errorEmitter = new common_1.Emitter();
|
|
38
|
+
this._killed = false;
|
|
39
|
+
this.id = this.processManager.register(this);
|
|
40
|
+
this.initialCwd = options && options.options && 'cwd' in options.options && options.options['cwd'].toString() || __dirname;
|
|
41
|
+
}
|
|
42
|
+
get killed() {
|
|
43
|
+
return this._killed;
|
|
44
|
+
}
|
|
45
|
+
get onStart() {
|
|
46
|
+
return this.startEmitter.event;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Wait for the process to exit, streams can still emit data.
|
|
50
|
+
*/
|
|
51
|
+
get onExit() {
|
|
52
|
+
return this.exitEmitter.event;
|
|
53
|
+
}
|
|
54
|
+
get onError() {
|
|
55
|
+
return this.errorEmitter.event;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Waits for both process exit and for all the streams to be closed.
|
|
59
|
+
*/
|
|
60
|
+
get onClose() {
|
|
61
|
+
return this.closeEmitter.event;
|
|
62
|
+
}
|
|
63
|
+
emitOnStarted() {
|
|
64
|
+
this.startEmitter.fire({});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Emit the onExit event for this process. Only one of code and signal
|
|
68
|
+
* should be defined.
|
|
69
|
+
*/
|
|
70
|
+
emitOnExit(code, signal) {
|
|
71
|
+
const exitEvent = { code, signal };
|
|
72
|
+
this.handleOnExit(exitEvent);
|
|
73
|
+
this.exitEmitter.fire(exitEvent);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Emit the onClose event for this process. Only one of code and signal
|
|
77
|
+
* should be defined.
|
|
78
|
+
*/
|
|
79
|
+
emitOnClose(code, signal) {
|
|
80
|
+
this.closeEmitter.fire({ code, signal });
|
|
81
|
+
}
|
|
82
|
+
handleOnExit(event) {
|
|
83
|
+
this._killed = true;
|
|
84
|
+
const signalSuffix = event.signal ? `, signal: ${event.signal}` : '';
|
|
85
|
+
const executable = this.isForkOptions(this.options) ? this.options.modulePath : this.options.command;
|
|
86
|
+
this.logger.debug(`Process ${this.pid} has exited with code ${event.code}${signalSuffix}.`, executable, this.options.args);
|
|
87
|
+
}
|
|
88
|
+
emitOnError(err) {
|
|
89
|
+
this.handleOnError(err);
|
|
90
|
+
this.errorEmitter.fire(err);
|
|
91
|
+
}
|
|
92
|
+
async emitOnErrorAsync(error) {
|
|
93
|
+
process.nextTick(this.emitOnError.bind(this), error);
|
|
94
|
+
}
|
|
95
|
+
handleOnError(error) {
|
|
96
|
+
this._killed = true;
|
|
97
|
+
this.logger.error(error);
|
|
98
|
+
}
|
|
99
|
+
isForkOptions(options) {
|
|
100
|
+
return (0, common_1.isObject)(options) && !!options.modulePath;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @returns the current working directory as a URI (usually file:// URI)
|
|
104
|
+
*/
|
|
105
|
+
getCwdURI() {
|
|
106
|
+
if (core_1.isOSX) {
|
|
107
|
+
return new Promise(resolve => {
|
|
108
|
+
(0, child_process_1.exec)('lsof -OPln -p ' + this.pid + ' | grep cwd', (error, stdout, stderr) => {
|
|
109
|
+
if (stdout !== '') {
|
|
110
|
+
resolve(node_1.FileUri.create(stdout.substring(stdout.indexOf('/'), stdout.length - 1)).toString());
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
resolve(node_1.FileUri.create(this.initialCwd).toString());
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
else if (!core_1.isWindows) {
|
|
119
|
+
return new Promise(resolve => {
|
|
120
|
+
fs.readlink('/proc/' + this.pid + '/cwd', (err, linkedstr) => {
|
|
121
|
+
if (err || !linkedstr) {
|
|
122
|
+
resolve(node_1.FileUri.create(this.initialCwd).toString());
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
resolve(node_1.FileUri.create(linkedstr).toString());
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return new Promise(resolve => {
|
|
132
|
+
resolve(node_1.FileUri.create(this.initialCwd).toString());
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
Process = (0, tslib_1.__decorate)([
|
|
138
|
+
(0, inversify_1.injectable)(),
|
|
139
|
+
(0, tslib_1.__param)(2, (0, inversify_1.unmanaged)()),
|
|
140
|
+
(0, tslib_1.__metadata)("design:paramtypes", [Object, Object, Number, Object])
|
|
141
|
+
], Process);
|
|
142
|
+
exports.Process = Process;
|
|
143
143
|
//# sourceMappingURL=process.js.map
|
package/lib/node/pseudo-pty.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { IPty } from 'node-pty';
|
|
2
|
-
import { Event } from '@theia/core';
|
|
3
|
-
export declare class PseudoPty implements IPty {
|
|
4
|
-
readonly pid: number;
|
|
5
|
-
readonly cols: number;
|
|
6
|
-
readonly rows: number;
|
|
7
|
-
readonly process: string;
|
|
8
|
-
handleFlowControl: boolean;
|
|
9
|
-
readonly onData: Event<string>;
|
|
10
|
-
readonly onExit: Event<{
|
|
11
|
-
exitCode: number;
|
|
12
|
-
signal?: number;
|
|
13
|
-
}>;
|
|
14
|
-
on(event: string, listener: (data: string) => void): void;
|
|
15
|
-
on(event: string, listener: (exitCode: number, signal?: number) => void): void;
|
|
16
|
-
on(event: string, listener: (error?: string) => void): void;
|
|
17
|
-
resize(columns: number, rows: number): void;
|
|
18
|
-
write(data: string): void;
|
|
19
|
-
kill(signal?: string): void;
|
|
20
|
-
pause(): void;
|
|
21
|
-
resume(): void;
|
|
22
|
-
}
|
|
1
|
+
import { IPty } from 'node-pty';
|
|
2
|
+
import { Event } from '@theia/core';
|
|
3
|
+
export declare class PseudoPty implements IPty {
|
|
4
|
+
readonly pid: number;
|
|
5
|
+
readonly cols: number;
|
|
6
|
+
readonly rows: number;
|
|
7
|
+
readonly process: string;
|
|
8
|
+
handleFlowControl: boolean;
|
|
9
|
+
readonly onData: Event<string>;
|
|
10
|
+
readonly onExit: Event<{
|
|
11
|
+
exitCode: number;
|
|
12
|
+
signal?: number;
|
|
13
|
+
}>;
|
|
14
|
+
on(event: string, listener: (data: string) => void): void;
|
|
15
|
+
on(event: string, listener: (exitCode: number, signal?: number) => void): void;
|
|
16
|
+
on(event: string, listener: (error?: string) => void): void;
|
|
17
|
+
resize(columns: number, rows: number): void;
|
|
18
|
+
write(data: string): void;
|
|
19
|
+
kill(signal?: string): void;
|
|
20
|
+
pause(): void;
|
|
21
|
+
resume(): void;
|
|
22
|
+
}
|
|
23
23
|
//# sourceMappingURL=pseudo-pty.d.ts.map
|
package/lib/node/pseudo-pty.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2020 Alibaba 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.PseudoPty = void 0;
|
|
19
|
-
const core_1 = require("@theia/core");
|
|
20
|
-
class PseudoPty {
|
|
21
|
-
constructor() {
|
|
22
|
-
this.pid = -1;
|
|
23
|
-
this.cols = -1;
|
|
24
|
-
this.rows = -1;
|
|
25
|
-
this.process = '';
|
|
26
|
-
this.handleFlowControl = false;
|
|
27
|
-
this.onData = core_1.Event.None;
|
|
28
|
-
this.onExit = core_1.Event.None;
|
|
29
|
-
}
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
-
on(event, listener) { }
|
|
32
|
-
resize(columns, rows) { }
|
|
33
|
-
write(data) { }
|
|
34
|
-
kill(signal) { }
|
|
35
|
-
pause() { }
|
|
36
|
-
resume() { }
|
|
37
|
-
}
|
|
38
|
-
exports.PseudoPty = PseudoPty;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 Alibaba 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.PseudoPty = void 0;
|
|
19
|
+
const core_1 = require("@theia/core");
|
|
20
|
+
class PseudoPty {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.pid = -1;
|
|
23
|
+
this.cols = -1;
|
|
24
|
+
this.rows = -1;
|
|
25
|
+
this.process = '';
|
|
26
|
+
this.handleFlowControl = false;
|
|
27
|
+
this.onData = core_1.Event.None;
|
|
28
|
+
this.onExit = core_1.Event.None;
|
|
29
|
+
}
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
on(event, listener) { }
|
|
32
|
+
resize(columns, rows) { }
|
|
33
|
+
write(data) { }
|
|
34
|
+
kill(signal) { }
|
|
35
|
+
pause() { }
|
|
36
|
+
resume() { }
|
|
37
|
+
}
|
|
38
|
+
exports.PseudoPty = PseudoPty;
|
|
39
39
|
//# sourceMappingURL=pseudo-pty.js.map
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ProcessManager } from './process-manager';
|
|
3
|
-
import { ILogger } from '@theia/core/lib/common';
|
|
4
|
-
import { Process, ProcessOptions, ForkOptions } from './process';
|
|
5
|
-
import { ChildProcess } from 'child_process';
|
|
6
|
-
import * as stream from 'stream';
|
|
7
|
-
export { DevNullStream } from './dev-null-stream';
|
|
8
|
-
export declare const RawProcessOptions: unique symbol;
|
|
9
|
-
/**
|
|
10
|
-
* Options to spawn a new process (`spawn`).
|
|
11
|
-
*
|
|
12
|
-
* For more information please refer to the spawn function of Node's
|
|
13
|
-
* child_process module:
|
|
14
|
-
*
|
|
15
|
-
* https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
|
|
16
|
-
*/
|
|
17
|
-
export interface RawProcessOptions extends ProcessOptions {
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Options to fork a new process using the current Node interpreter (`fork`).
|
|
21
|
-
*
|
|
22
|
-
* For more information please refer to the fork function of Node's
|
|
23
|
-
* `child_process` module:
|
|
24
|
-
*
|
|
25
|
-
* https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options
|
|
26
|
-
*/
|
|
27
|
-
export interface RawForkOptions extends ForkOptions {
|
|
28
|
-
}
|
|
29
|
-
export declare const RawProcessFactory: unique symbol;
|
|
30
|
-
export interface RawProcessFactory {
|
|
31
|
-
(options: RawProcessOptions | RawForkOptions): RawProcess;
|
|
32
|
-
}
|
|
33
|
-
export declare class RawProcess extends Process {
|
|
34
|
-
/**
|
|
35
|
-
* If the process fails to launch, it will be undefined.
|
|
36
|
-
*/
|
|
37
|
-
readonly process: ChildProcess | undefined;
|
|
38
|
-
readonly outputStream: stream.Readable;
|
|
39
|
-
readonly errorStream: stream.Readable;
|
|
40
|
-
readonly inputStream: stream.Writable;
|
|
41
|
-
constructor(// eslint-disable-next-line @typescript-eslint/indent
|
|
42
|
-
options: RawProcessOptions | RawForkOptions, processManager: ProcessManager, logger: ILogger);
|
|
43
|
-
get pid(): number;
|
|
44
|
-
kill(signal?: string): void;
|
|
45
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ProcessManager } from './process-manager';
|
|
3
|
+
import { ILogger } from '@theia/core/lib/common';
|
|
4
|
+
import { Process, ProcessOptions, ForkOptions } from './process';
|
|
5
|
+
import { ChildProcess } from 'child_process';
|
|
6
|
+
import * as stream from 'stream';
|
|
7
|
+
export { DevNullStream } from './dev-null-stream';
|
|
8
|
+
export declare const RawProcessOptions: unique symbol;
|
|
9
|
+
/**
|
|
10
|
+
* Options to spawn a new process (`spawn`).
|
|
11
|
+
*
|
|
12
|
+
* For more information please refer to the spawn function of Node's
|
|
13
|
+
* child_process module:
|
|
14
|
+
*
|
|
15
|
+
* https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
|
|
16
|
+
*/
|
|
17
|
+
export interface RawProcessOptions extends ProcessOptions {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Options to fork a new process using the current Node interpreter (`fork`).
|
|
21
|
+
*
|
|
22
|
+
* For more information please refer to the fork function of Node's
|
|
23
|
+
* `child_process` module:
|
|
24
|
+
*
|
|
25
|
+
* https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options
|
|
26
|
+
*/
|
|
27
|
+
export interface RawForkOptions extends ForkOptions {
|
|
28
|
+
}
|
|
29
|
+
export declare const RawProcessFactory: unique symbol;
|
|
30
|
+
export interface RawProcessFactory {
|
|
31
|
+
(options: RawProcessOptions | RawForkOptions): RawProcess;
|
|
32
|
+
}
|
|
33
|
+
export declare class RawProcess extends Process {
|
|
34
|
+
/**
|
|
35
|
+
* If the process fails to launch, it will be undefined.
|
|
36
|
+
*/
|
|
37
|
+
readonly process: ChildProcess | undefined;
|
|
38
|
+
readonly outputStream: stream.Readable;
|
|
39
|
+
readonly errorStream: stream.Readable;
|
|
40
|
+
readonly inputStream: stream.Writable;
|
|
41
|
+
constructor(// eslint-disable-next-line @typescript-eslint/indent
|
|
42
|
+
options: RawProcessOptions | RawForkOptions, processManager: ProcessManager, logger: ILogger);
|
|
43
|
+
get pid(): number;
|
|
44
|
+
kill(signal?: string): void;
|
|
45
|
+
}
|
|
46
46
|
//# sourceMappingURL=raw-process.d.ts.map
|