You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current plan for issue #9 (wire executable I/O through ShellIo) uses Command::output(), which buffers the child process's entire stdout/stderr before writing it to ShellIo. This is correct but not streaming — output is held in memory until the child exits.
For a performant shell, output should be forwarded to the caller incrementally as the child produces it, rather than buffered entirely in memory.
Problem
ShellIo::out_writer() returns &mut dyn Write, and std::process::Command accepts Stdio (file handles, pipes, or inherit) — there is no way to hand a dyn Write directly to the OS-level pipe. Bridging the two requires either:
A dedicated reader thread per child stream (stdout + stderr), copying bytes from the pipe read end into ShellIo as they arrive
An async/io-uring approach for non-blocking I/O multiplexing
Acceptance Criteria
External command stdout and stderr are forwarded to ShellIo incrementally (no full-output buffering)
MockIo still captures all output correctly in tests
Works for both StandardIo (real terminal) and MockIo (test harness)
Large output (e.g., piping a multi-GB file) does not cause excessive memory use
Background
The current plan for issue #9 (wire executable I/O through
ShellIo) usesCommand::output(), which buffers the child process's entire stdout/stderr before writing it toShellIo. This is correct but not streaming — output is held in memory until the child exits.For a performant shell, output should be forwarded to the caller incrementally as the child produces it, rather than buffered entirely in memory.
Problem
ShellIo::out_writer()returns&mut dyn Write, andstd::process::CommandacceptsStdio(file handles, pipes, or inherit) — there is no way to hand adyn Writedirectly to the OS-level pipe. Bridging the two requires either:ShellIoas they arriveAcceptance Criteria
ShellIoincrementally (no full-output buffering)MockIostill captures all output correctly in testsStandardIo(real terminal) andMockIo(test harness)Notes
ShellIowiring