mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-31 12:49:41 +01:00
cli: avoid interactions when running integrated (#167780)
Fixes https://github.com/microsoft/vscode/issues/167760 The VS Code CLI gets run from a bash/shell script. This prevents interactions--in the former case, it doesn't look like a tty, and in the latter case batch scripts don't seem to support having interactive subprocesses. This PR avoids interactions if stdin is not a tty, prompting the user to use the flag instead. Use of the flag is also persisted like an interactive agreement prompt.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ChildProcess, spawn, SpawnOptions } from 'child_process';
|
||||
import { ChildProcess, ChildProcessWithoutNullStreams, spawn, SpawnOptions } from 'child_process';
|
||||
import { chmodSync, existsSync, readFileSync, statSync, truncateSync, unlinkSync } from 'fs';
|
||||
import { homedir, release, tmpdir } from 'os';
|
||||
import type { ProfilingSession, Target } from 'v8-inspect-profiler';
|
||||
@@ -55,7 +55,7 @@ export async function main(argv: string[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
let tunnelProcess;
|
||||
let tunnelProcess: ChildProcessWithoutNullStreams;
|
||||
if (process.env['VSCODE_DEV']) {
|
||||
tunnelProcess = spawn('cargo', ['run', '--', 'tunnel', ...argv.slice(5)], { cwd: join(getAppRoot(), 'cli') });
|
||||
} else {
|
||||
@@ -67,12 +67,9 @@ export async function main(argv: string[]): Promise<any> {
|
||||
const tunnelArgs = argv.slice(3);
|
||||
tunnelProcess = spawn(tunnelCommand, ['tunnel', ...tunnelArgs]);
|
||||
}
|
||||
tunnelProcess.stdout.on('data', data => {
|
||||
console.log(data.toString());
|
||||
});
|
||||
tunnelProcess.stderr.on('data', data => {
|
||||
console.error(data.toString());
|
||||
});
|
||||
|
||||
tunnelProcess.stdout.pipe(process.stdout);
|
||||
tunnelProcess.stderr.pipe(process.stderr);
|
||||
tunnelProcess.on('exit', resolve);
|
||||
tunnelProcess.on('error', reject);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user