Fix bug when shell profile is not found (#1671)

This commit is contained in:
Matt Rubens authored and GitHub committed 2025-02-06 12:12:25 -08:00
1 parent 548338d39e
commit 10b8ee4f54
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -78,6 +78,11 @@ describe("Shell Detection Tests", () => {
expect(getShell()).to.equal("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe")
})
it("handles undefined shell profile gracefully", () => {
mockVsCodeConfig("windows", "NonExistentProfile", {})
expect(getShell()).to.equal("C:\\Windows\\System32\\cmd.exe")
})
it("uses WSL bash when profile indicates WSL source", () => {
mockVsCodeConfig("windows", "WSL", {
WSL: { source: "WSL" },
+1 -1
View File
@@ -105,7 +105,7 @@ function getWindowsShellFromVSCode(): string | null {
}
// If there's a specific path, return that immediately
if (profile.path) {
if (profile?.path) {
return profile.path
}