Skip to content
Open
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
6 changes: 5 additions & 1 deletion src/terminal-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,14 @@ export class TerminalManager {
// Use shell-specific configuration with login flags where appropriate
spawnConfig = getShellSpawnArgs(shellToUse, enhancedCommand);
spawnOptions = {
stdio: ['pipe', 'pipe', 'pipe'] as const,
windowsHide: true, // Prevent .NET-based shells (pwsh.exe) from allocating a new console
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comment about windowsHide: true is likely overstating what Node guarantees. In Node.js, windowsHide hides the console window (and may set CREATE_NO_WINDOW), but it doesn’t strictly “prevent” a .NET runtime from calling AllocConsole(). Consider rephrasing to reflect the actual behavior (hide the window / avoid showing a new console) so future debugging isn’t misled.

Suggested change
windowsHide: true, // Prevent .NET-based shells (pwsh.exe) from allocating a new console
windowsHide: true, // Request that Windows hide the console window (avoid showing a new console for .NET-based shells like pwsh.exe)

Copilot uses AI. Check for mistakes.
env: {
Comment on lines 159 to 162
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is addressing a Windows+pwsh-specific stdout capture regression, but there’s no automated test exercising “pwsh + external executable stdout” (e.g., pwsh -Command "python -c ..." or git --version"). Adding a Windows-gated regression test (skipping if pwsh isn’t present) would help prevent reintroducing the issue.

Copilot uses AI. Check for mistakes.
...process.env,
TERM: 'xterm-256color' // Better terminal compatibility
}
};

// Add shell option if needed (for unknown shells)
if (spawnConfig.useShellOption) {
spawnOptions.shell = spawnConfig.useShellOption;
Expand All @@ -176,6 +178,8 @@ export class TerminalManager {
};
spawnOptions = {
shell: shellToUse,
stdio: ['pipe', 'pipe', 'pipe'] as const,
windowsHide: true,
env: {
...process.env,
TERM: 'xterm-256color'
Expand Down
Loading