Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/node/runtime/LocalBaseRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export abstract class LocalBaseRuntime implements Runtime {
// NOTE: detached:true does NOT cause bash to wait for background jobs when using 'exit' event
// instead of 'close' event. The 'exit' event fires when bash exits, ignoring background children.
detached: true,
// Prevent console window from appearing on Windows (WSL bash spawns steal focus otherwise)
windowsHide: true,
});

// Wrap in DisposableProcess for automatic cleanup
Expand Down Expand Up @@ -373,6 +375,8 @@ export abstract class LocalBaseRuntime implements Runtime {
...process.env,
...getInitHookEnv(projectPath, runtimeType),
},
// Prevent console window from appearing on Windows
windowsHide: true,
});

proc.stdout.on("data", (data: Buffer) => {
Expand Down
12 changes: 10 additions & 2 deletions src/node/runtime/SSHRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ export class SSHRuntime implements Runtime {
// Spawn ssh command
const sshProcess = spawn("ssh", sshArgs, {
stdio: ["pipe", "pipe", "pipe"],
// Prevent console window from appearing on Windows
windowsHide: true,
});

// Wrap in DisposableProcess for automatic cleanup
Expand Down Expand Up @@ -408,7 +410,10 @@ export class SSHRuntime implements Runtime {
sshArgs.push(this.config.host, command);

return new Promise((resolve, reject) => {
const proc = spawn("ssh", sshArgs);
const proc = spawn("ssh", sshArgs, {
// Prevent console window from appearing on Windows
windowsHide: true,
});
let stdout = "";
let stderr = "";
let timedOut = false;
Expand Down Expand Up @@ -591,7 +596,10 @@ export class SSHRuntime implements Runtime {

log.debug(`Creating bundle: ${command}`);
const bashPath = getBashPath();
const proc = spawn(bashPath, ["-c", command]);
const proc = spawn(bashPath, ["-c", command], {
// Prevent console window from appearing on Windows
windowsHide: true,
});

const cleanup = streamProcessToLogger(proc, initLogger, {
logStdout: false,
Expand Down
2 changes: 2 additions & 0 deletions src/node/services/bashExecutionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ export class BashExecutionService {
// When bash spawns background processes, detached:true allows killing
// the entire group via process.kill(-pid)
detached: config.detached ?? true,
// Prevent console window from appearing on Windows (WSL bash spawns steal focus otherwise)
windowsHide: true,
});

log.debug(`BashExecutionService: Spawned process with PID ${child.pid ?? "unknown"}`);
Expand Down