diff --git a/dev-packages/application-manager/src/application-process.ts b/dev-packages/application-manager/src/application-process.ts index 47fda1c743ba1..2befd37bcfc50 100644 --- a/dev-packages/application-manager/src/application-process.ts +++ b/dev-packages/application-manager/src/application-process.ts @@ -32,7 +32,10 @@ export class ApplicationProcess { ) { } spawn(command: string, args?: string[], options?: cp.SpawnOptions): cp.ChildProcess { - return cp.spawn(command, args || [], Object.assign({}, this.defaultOptions, options)); + return cp.spawn(command, args || [], Object.assign({}, this.defaultOptions, { + ...options, + shell: true + })); } fork(modulePath: string, args?: string[], options?: cp.ForkOptions): cp.ChildProcess { @@ -50,7 +53,10 @@ export class ApplicationProcess { spawnBin(command: string, args: string[], options?: cp.SpawnOptions): cp.ChildProcess { const binPath = this.resolveBin(command); - return this.spawn(binPath, args, options); + return this.spawn(binPath, args, { + ...options, + shell: true + }); } protected resolveBin(command: string): string { diff --git a/dev-packages/cli/bin/theia-patch.js b/dev-packages/cli/bin/theia-patch.js index 5c9e7ad2ad828..a6a511fa9b2dd 100755 --- a/dev-packages/cli/bin/theia-patch.js +++ b/dev-packages/cli/bin/theia-patch.js @@ -19,7 +19,7 @@ const path = require('path'); const cp = require('child_process'); -const patchPackage= require.resolve('patch-package'); +const patchPackage = require.resolve('patch-package'); console.log(`patch-package = ${patchPackage}`); const patchesDir = path.join('.', 'node_modules', '@theia', 'cli', 'patches'); @@ -28,10 +28,9 @@ console.log(`patchesdir = ${patchesDir}`); const env = Object.assign({}, process.env); -const scriptProcess = cp.exec(`node ${patchPackage} --patch-dir "${patchesDir}"`, { +const scriptProcess = cp.exec(`node "${patchPackage}" --patch-dir "${patchesDir}"`, { cwd: process.cwd(), - env, - + env }); scriptProcess.stdout.pipe(process.stdout); diff --git a/dev-packages/native-webpack-plugin/src/native-webpack-plugin.ts b/dev-packages/native-webpack-plugin/src/native-webpack-plugin.ts index eafa1a01ac386..7ff3c13e20fcc 100644 --- a/dev-packages/native-webpack-plugin/src/native-webpack-plugin.ts +++ b/dev-packages/native-webpack-plugin/src/native-webpack-plugin.ts @@ -124,10 +124,6 @@ export class NativeWebpackPlugin { const dllFile = require.resolve('node-pty/build/Release/winpty.dll'); const targetDllFile = path.join(targetDirectory, 'winpty.dll'); await this.copyExecutable(dllFile, targetDllFile); - } else { - const sourceFile = require.resolve('node-pty/build/Release/spawn-helper'); - const targetFile = path.join(targetDirectory, 'spawn-helper'); - await this.copyExecutable(sourceFile, targetFile); } } diff --git a/dev-packages/private-re-exports/src/package-re-exports.ts b/dev-packages/private-re-exports/src/package-re-exports.ts index 40aebc7a91db4..65f0fddfc4750 100644 --- a/dev-packages/private-re-exports/src/package-re-exports.ts +++ b/dev-packages/private-re-exports/src/package-re-exports.ts @@ -177,7 +177,8 @@ export class PackageReExports { ELECTRON_RUN_AS_NODE: '1' }, encoding: 'utf8', - stdio: ['ignore', 'pipe', 'inherit'] + stdio: ['ignore', 'pipe', 'inherit'], + shell: true }); const [packageRoot, reExports] = JSON.parse(stdout) as [string, ReExport[]]; return new PackageReExports(packageName, packageRoot, reExports); diff --git a/packages/process/package.json b/packages/process/package.json index 736f1b4b13ae0..ca4e0cd22b8c3 100644 --- a/packages/process/package.json +++ b/packages/process/package.json @@ -4,7 +4,7 @@ "description": "Theia process support.", "dependencies": { "@theia/core": "1.48.0", - "node-pty": "0.11.0-beta17", + "node-pty": "0.11.0-beta24", "string-argv": "^0.1.1", "tslib": "^2.6.2" }, diff --git a/packages/process/src/node/pseudo-pty.ts b/packages/process/src/node/pseudo-pty.ts index 245a66dd2b211..b44cb5f7a126b 100644 --- a/packages/process/src/node/pseudo-pty.ts +++ b/packages/process/src/node/pseudo-pty.ts @@ -51,4 +51,6 @@ export class PseudoPty implements IPty { pause(): void { } resume(): void { } + + clear(): void { } } diff --git a/packages/terminal/src/node/shell-terminal-server.ts b/packages/terminal/src/node/shell-terminal-server.ts index 63eded6a30618..bb2270f162574 100644 --- a/packages/terminal/src/node/shell-terminal-server.ts +++ b/packages/terminal/src/node/shell-terminal-server.ts @@ -69,7 +69,9 @@ export class ShellTerminalServer extends BaseTerminalServer implements IShellTer private spawnAsPromised(command: string, args: string[]): Promise { return new Promise((resolve, reject) => { let stdout = ''; - const child = cp.spawn(command, args); + const child = cp.spawn(command, args, { + shell: true + }); if (child.pid) { child.stdout.on('data', (data: Buffer) => { stdout += data.toString(); diff --git a/yarn.lock b/yarn.lock index 489221288bada..8b45a3820e7f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8594,12 +8594,12 @@ node-preload@^0.2.1: dependencies: process-on-spawn "^1.0.0" -node-pty@0.11.0-beta17: - version "0.11.0-beta17" - resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.11.0-beta17.tgz#7df6a60dced6bf7a3a282b65cf51980c68954af6" - integrity sha512-JALo4LgYKmzmmXI23CIfS6DpCuno647YJpNg3RT6jCKTHWrt+RHeB6JAlb/pJG9dFNSeaiIAWD+0waEg2AzlfA== +node-pty@0.11.0-beta24: + version "0.11.0-beta24" + resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.11.0-beta24.tgz#084841017187656edaf14b459946c4a1d7cf8392" + integrity sha512-CzItw3hitX+wnpw9dHA/A+kcbV7ETNKrsyQJ+s0ZGzsu70+CSGuIGPLPfMnAc17vOrQktxjyRQfaqij75GVJFw== dependencies: - nan "^2.14.0" + nan "^2.17.0" node-releases@^2.0.14: version "2.0.14"