shellProvider.ts
utils/shell/shellProvider.ts
34
Lines
955
Bytes
4
Exports
0
Imports
10
Keywords
What this is
This page documents one file from the repository and includes its full source so you can read it without leaving the docs site.
Beginner explanation
This file is one piece of the larger system. Its name, directory, imports, and exports show where it fits. Start by reading the exports and related files first.
How it is used
Start from the exports list and related files. Those are the easiest clues for where this file fits into the system.
Expert explanation
Architecturally, this file intersects with shell-safety. It contains 34 lines, 0 detected imports, and 4 detected exports.
Important relationships
Detected exports
SHELL_TYPESShellTypeDEFAULT_HOOK_SHELLShellProvider
Keywords
bashshelltypecommandshell_typessetuppromisecommandstringshellpowershelltypeof
Detected imports
- No import paths detected.
Source notes
This page embeds the full file contents. Small or leaf files are still indexed honestly instead of being over-explained.
Full source
export const SHELL_TYPES = ['bash', 'powershell'] as const
export type ShellType = (typeof SHELL_TYPES)[number]
export const DEFAULT_HOOK_SHELL: ShellType = 'bash'
export type ShellProvider = {
type: ShellType
shellPath: string
detached: boolean
/**
* Build the full command string including all shell-specific setup.
* For bash: source snapshot, session env, disable extglob, eval-wrap, pwd tracking.
*/
buildExecCommand(
command: string,
opts: {
id: number | string
sandboxTmpDir?: string
useSandbox: boolean
},
): Promise<{ commandString: string; cwdFilePath: string }>
/**
* Shell args for spawn (e.g., ['-c', '-l', cmd] for bash).
*/
getSpawnArgs(commandString: string): string[]
/**
* Extra env vars for this shell type.
* May perform async initialization (e.g., tmux socket setup for bash).
*/
getEnvironmentOverrides(command: string): Promise<Record<string, string>>
}