fix(desktop): few WSL bugs (#31095)

This commit is contained in:
Filip
2026-06-08 02:05:54 +00:00
committed by GitHub
parent b1d14acc35
commit 65a3f7f749
13 changed files with 231 additions and 50 deletions
+4 -3
View File
@@ -1,11 +1,13 @@
import { spawnSync } from "node:child_process"
import { userInfo } from "node:os"
import { basename } from "node:path"
import { getLogger } from "./logging"
const TIMEOUT = 5_000
type Probe = { type: "Loaded"; value: Record<string, string> } | { type: "Timeout" } | { type: "Unavailable" }
type ShellEnvLogger = {
log: (message: string) => void
}
export function resolveUserShell(envShell: string | undefined, loginShell: string | null | undefined) {
const resolvedLoginShell = loginShell && loginShell !== "unknown" ? loginShell : undefined
@@ -65,8 +67,7 @@ export function isNushell(shell: string) {
return name === "nu" || name === "nu.exe" || raw.endsWith("\\nu.exe")
}
export function loadShellEnv(shell: string) {
const logger = getLogger()
export function loadShellEnv(shell: string, logger: ShellEnvLogger) {
if (isNushell(shell)) {
logger.log(`[server] Skipping shell env probe for nushell: ${shell}`)
return null