@theia/process 1.48.1 → 1.48.3

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.
Files changed (69) hide show
  1. package/README.md +30 -30
  2. package/lib/common/process-common-module.d.ts +3 -3
  3. package/lib/common/process-common-module.js +22 -22
  4. package/lib/common/process-manager-types.d.ts +35 -35
  5. package/lib/common/process-manager-types.js +23 -23
  6. package/lib/common/shell-command-builder.d.ts +49 -49
  7. package/lib/common/shell-command-builder.js +169 -169
  8. package/lib/common/shell-command-builder.slow-spec.d.ts +9 -9
  9. package/lib/common/shell-command-builder.slow-spec.js +404 -404
  10. package/lib/common/shell-quoting.d.ts +91 -91
  11. package/lib/common/shell-quoting.js +145 -145
  12. package/lib/common/shell-quoting.spec.d.ts +1 -1
  13. package/lib/common/shell-quoting.spec.js +170 -170
  14. package/lib/node/dev-null-stream.d.ts +17 -17
  15. package/lib/node/dev-null-stream.js +41 -41
  16. package/lib/node/index.d.ts +6 -6
  17. package/lib/node/index.js +24 -24
  18. package/lib/node/multi-ring-buffer.d.ts +68 -68
  19. package/lib/node/multi-ring-buffer.js +299 -299
  20. package/lib/node/multi-ring-buffer.spec.d.ts +1 -1
  21. package/lib/node/multi-ring-buffer.spec.js +422 -422
  22. package/lib/node/process-backend-module.d.ts +3 -3
  23. package/lib/node/process-backend-module.js +56 -56
  24. package/lib/node/process-manager.d.ts +33 -33
  25. package/lib/node/process-manager.js +102 -102
  26. package/lib/node/process.d.ts +95 -95
  27. package/lib/node/process.js +142 -142
  28. package/lib/node/pseudo-pty.d.ts +22 -22
  29. package/lib/node/pseudo-pty.js +38 -38
  30. package/lib/node/raw-process.d.ts +45 -45
  31. package/lib/node/raw-process.js +104 -104
  32. package/lib/node/raw-process.spec.d.ts +1 -1
  33. package/lib/node/raw-process.spec.js +164 -164
  34. package/lib/node/task-terminal-process.d.ts +10 -10
  35. package/lib/node/task-terminal-process.js +42 -42
  36. package/lib/node/terminal-process.d.ts +60 -60
  37. package/lib/node/terminal-process.js +248 -248
  38. package/lib/node/terminal-process.spec.d.ts +1 -1
  39. package/lib/node/terminal-process.spec.js +103 -103
  40. package/lib/node/test/process-test-container.d.ts +2 -2
  41. package/lib/node/test/process-test-container.js +28 -28
  42. package/lib/node/utils.d.ts +16 -16
  43. package/lib/node/utils.js +77 -77
  44. package/package.json +4 -4
  45. package/src/common/process-common-module.ts +22 -22
  46. package/src/common/process-manager-types.ts +58 -58
  47. package/src/common/shell-command-builder.slow-spec.ts +486 -486
  48. package/src/common/shell-command-builder.ts +187 -187
  49. package/src/common/shell-quoting.spec.ts +176 -176
  50. package/src/common/shell-quoting.ts +236 -236
  51. package/src/common/tests/$weird(),file=name.js +1 -1
  52. package/src/common/tests/white space.js +1 -1
  53. package/src/node/dev-null-stream.ts +47 -47
  54. package/src/node/index.ts +22 -22
  55. package/src/node/multi-ring-buffer.spec.ts +486 -486
  56. package/src/node/multi-ring-buffer.ts +348 -348
  57. package/src/node/process-backend-module.ts +67 -67
  58. package/src/node/process-manager.ts +107 -107
  59. package/src/node/process.ts +207 -207
  60. package/src/node/pseudo-pty.ts +54 -54
  61. package/src/node/raw-process.spec.ts +199 -199
  62. package/src/node/raw-process.ts +156 -156
  63. package/src/node/string-argv.d.ts +21 -21
  64. package/src/node/task-terminal-process.ts +41 -41
  65. package/src/node/terminal-process.spec.ts +121 -121
  66. package/src/node/terminal-process.ts +290 -290
  67. package/src/node/test/process-fork-test.js +22 -22
  68. package/src/node/test/process-test-container.ts +27 -27
  69. 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