-
-
Notifications
You must be signed in to change notification settings - Fork 676
fix: add windowsHide and explicit stdio pipes to prevent pwsh.exe stdout loss #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| env: { | ||
|
Comment on lines
159
to
162
|
||
| ...process.env, | ||
| TERM: 'xterm-256color' // Better terminal compatibility | ||
| } | ||
| }; | ||
|
|
||
| // Add shell option if needed (for unknown shells) | ||
| if (spawnConfig.useShellOption) { | ||
| spawnOptions.shell = spawnConfig.useShellOption; | ||
|
|
@@ -176,6 +178,8 @@ export class TerminalManager { | |
| }; | ||
| spawnOptions = { | ||
| shell: shellToUse, | ||
| stdio: ['pipe', 'pipe', 'pipe'] as const, | ||
| windowsHide: true, | ||
| env: { | ||
| ...process.env, | ||
| TERM: 'xterm-256color' | ||
|
|
||
There was a problem hiding this comment.
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: trueis likely overstating what Node guarantees. In Node.js,windowsHidehides the console window (and may setCREATE_NO_WINDOW), but it doesn’t strictly “prevent” a .NET runtime from callingAllocConsole(). Consider rephrasing to reflect the actual behavior (hide the window / avoid showing a new console) so future debugging isn’t misled.