-
Notifications
You must be signed in to change notification settings - Fork 43
fix(shell): report PowerShell on Windows when no profile is configured (#82) #239
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 |
|---|---|---|
|
|
@@ -188,7 +188,13 @@ function normalizeShellPath(path: string | string[] | undefined): string | null | |
| function getWindowsShellFromVSCode(): string | null { | ||
| const { defaultProfileName, profiles } = getWindowsTerminalConfig() | ||
| if (!defaultProfileName) { | ||
| return null | ||
| // No explicit Windows terminal profile is configured. VS Code's built-in | ||
| // default on modern Windows is PowerShell (not cmd.exe), and that is the | ||
| // shell the integrated terminal actually launches. Mirror it here so the | ||
| // system prompt advertises the real shell instead of falling through to | ||
| // COMSPEC (cmd.exe). Windows PowerShell is always present, so it is a safe | ||
| // allowlisted default. See issue #82. | ||
| return SHELL_PATHS.POWERSHELL_LEGACY | ||
|
Comment on lines
+191
to
+197
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On a machine with PowerShell 7 installed, VS Code's auto-detection will typically select PS7 as the default terminal — not legacy 5.1. Commit |
||
| } | ||
|
|
||
| const profile = profiles[defaultProfileName] | ||
|
|
||
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.
Is this mock still needed? With the early return at
shell.ts:197,getShellFromUserInfo()is never called in this code path — so this mock value is never read. Removing it would make the test clearer about what's actually being exercised.