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
internal: Improve code quality of the moon_process crate (#2567)
* internal: Improve code quality of the moon_process crate.
- Fix command output being lost entirely when it contains invalid
UTF-8 (now lossy converted).
- Fix cache key collisions in `Command::get_cache_key` by
length-prefixing hashed fields, sorting env vars, and including
the env variant discriminant.
- Fix command line being logged after streamed output in
`exec_stream_and_capture_output`.
- Remove `unsafe` from `get_bin_name`.
- Return captured lines through join handles instead of
`Arc<RwLock<Vec>>`, and dedupe the stream reader loops.
- Remove dead code: `output_stream` module and commented-out
exec method.
- Replace magic signal/errno numbers with libc constants.
- Move the arg quoting test harness from `src/main.rs` to
`examples/args.rs` so it no longer builds as a default target.
- Clear the process registry after force-kill tasks complete,
not before.
- Declare all used tokio features; hoist `libc` to workspace deps.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Hoist windows-sys to workspace dependencies.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Add byte-level exec_stream_and_capture_output_bytes variant.
Tees raw chunks instead of lines: partial lines and carriage
return redraws render in real time, non-UTF-8 output is preserved,
and capture is byte-exact with redraw frames collapsed for clean
cache replay. Prefixes are inserted statefully at line starts.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Add test coverage for the moon_process crate.
Covers the Command builder API, cache key stability and collision
resistance, command line formatting, Output status/error conversion,
lossy output strings, SharedChild signal handling, the process
registry lifecycle, and all four exec methods (capture, continuous,
stream, stream+capture) against real child processes. Process
spawning tests are unix-gated.
Also derives Debug for Output and ChildExit.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Fix relative working dir test on Windows.
Build the working dir with join so it uses the native path
separator; a forward slash literal is preserved as-is on Windows
and never matches the expected backslash output.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
0 commit comments