(env: CliEnv)
| 39 | } |
| 40 | |
| 41 | function detectFromEnvironment(env: CliEnv): ShellName | null { |
| 42 | const candidates: Array<string | undefined> = [] |
| 43 | |
| 44 | if (process.platform === 'win32') { |
| 45 | candidates.push(env.COMSPEC, env.SHELL) |
| 46 | } else { |
| 47 | candidates.push(env.SHELL) |
| 48 | } |
| 49 | |
| 50 | for (const candidate of candidates) { |
| 51 | const normalized = normalizeCandidate(candidate) |
| 52 | if (normalized) { |
| 53 | return normalized |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | return null |
| 58 | } |
| 59 | |
| 60 | function detectViaParentProcessInspection(): ShellName | null { |
| 61 | try { |
no test coverage detected