How gariyong/choco-shell works
Choco Shell is a C/POSIX command-line shell with an optional terminal file-browser panel. The user enters a line; the shell records it, parses command lists and pipelines, then executes eligible pipelines as built-ins or child processes with job control and I/O wiring. Results are reflected in exit status, job notifications, and the next prompt. The graph also preserves editing/completion, history, status explanations, and the explorer. Edges follow the README’s execution-flow description and shown call/reference evidence; unsampled implementation details are not inferred.
Main entry points: jobs.c Job control · main.c Shell loop · executor.c Pipeline executor · process.c Process spawning
Components 16
Shell interaction
- Shell loop
src/main.c - Prompt and input
src/prompt.c - Line editor
src/lineedit.c - Tab completion
src/complete.c - Command history
src/history.c
Command language
- Parser and expansion
src/parser.c - Built-in commands
src/builtin.c
Execution and jobs
- Pipeline executor
src/executor.c - Process spawning
src/process.c - Job control
src/jobs.c - Signal handling
src/signal_handler.c - Exit status explanations
src/status.c
I/O and terminal UI
- Pipe setup
src/pipeline.c - Redirection
src/redirect.c - File explorer panel
src/explorer.c
Other components
- User
Connections 29
- User → Prompt and input: enters commands
README.md - Shell loop → Prompt and input: reads input
src/main.c - Shell loop → Parser and expansion: parses lines
src/main.c - Shell loop → Command history: records input
src/main.c - Shell loop → Pipeline executor: executes pipelines
src/main.c - Shell loop → Job control: reaps jobs
src/main.c - Shell loop → Signal handling: initializes signals
src/main.c - Shell loop → File explorer panel: refreshes panel
src/main.c - Prompt and input → Line editor: reads edited input
README.md - Line editor → Tab completion: requests completion
src/lineedit.c - Line editor → Job control: registers notify hook
src/lineedit.c - Prompt and input → File explorer panel: checks panel state
src/prompt.c - Parser and expansion → Pipeline executor: produces pipeline
README.md - Pipeline executor → Built-in commands: dispatches built-ins
src/executor.c - Pipeline executor → Process spawning: spawns commands
README.md - Pipeline executor → Pipe setup: sets up pipes
README.md - Pipeline executor → Job control: registers background jobs
README.md - Pipeline executor → Exit status explanations: reports pipeline status
src/executor.c - Process spawning → Pipe setup: connects pipe ends
README.md - Process spawning → Redirection: applies redirection
README.md - Process spawning → Built-in commands: runs child built-ins
- Process spawning → Signal handling: resets child signals
- Process spawning → Exit status explanations: converts wait status
src/process.c - Job control → Process spawning: waits for jobs
src/jobs.c - Job control → Signal handling: handles child events
src/jobs.c - Job control → Exit status explanations: formats job outcomes
src/jobs.c - Job control → File explorer panel: coordinates notifications
src/jobs.c - Built-in commands → Job control: runs job commands
src/builtin.c - Built-in commands → Command history: prints history
src/builtin.c