(env: CliEnv = getCliEnv())
| 28 | } |
| 29 | |
| 30 | export function detectShell(env: CliEnv = getCliEnv()): ShellName { |
| 31 | if (cachedShell) { |
| 32 | return cachedShell |
| 33 | } |
| 34 | |
| 35 | const detected = |
| 36 | detectFromEnvironment(env) ?? detectViaParentProcessInspection() ?? 'unknown' |
| 37 | cachedShell = detected |
| 38 | return detected |
| 39 | } |
| 40 | |
| 41 | function detectFromEnvironment(env: CliEnv): ShellName | null { |
| 42 | const candidates: Array<string | undefined> = [] |
no test coverage detected