MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / detectShell

Function detectShell

cli/src/utils/detect-shell.ts:30–39  ·  view source on GitHub ↗
(env: CliEnv = getCliEnv())

Source from the content-addressed store, hash-verified

28}
29
30export 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
41function detectFromEnvironment(env: CliEnv): ShellName | null {
42 const candidates: Array<string | undefined> = []

Callers 1

Calls 3

getCliEnvFunction · 0.90
detectFromEnvironmentFunction · 0.85

Tested by

no test coverage detected