Skip to main content

Module command

Module command 

Source
Expand description

Command execution: ExecContext, redirects, and builtin dispatch (pwd, cd, ls, mkdir, cat, touch, echo, export-readonly, save, todo, exit/quit).

Structs§

ExecContext
Execution context: VFS and standard streams for one command.

Enums§

BuiltinError
Error from builtin execution (redirect or VFS failure, unknown command).
RunResult
Result of running a pipeline: continue the REPL loop or exit.

Constants§

PIPELINE_INTER_STAGE_MAX_BYTES
Maximum bytes buffered for a non-terminal pipeline stage’s stdout (host memory; design §8.2).

Functions§

execute_pipeline
Execute a pipeline: run each command with stdin from previous stage (or ctx.stdin for first), stdout to a buffer; last command’s stdout is written to ctx.stdout. Redirects override pipe.
run_builtin
Apply redirects: build optional stdin (Cursor over file content), stdout/stderr buffers. Then run the builtin with the effective streams; after that write stdout/stderr buffers to vfs if redirected.