Module shell_streaming

Module shell_streaming 

Source
Expand description

Streaming shell execution for real-time output to the frontend.

Unlike shell_async, which blocks until the command finishes and returns a single String, this module uses tokio::process::Command to spawn the process asynchronously and forwards stdout/stderr line-by-line via StreamChunk::ShellOutput events. A StreamChunk::ShellLifecycle event is emitted at process start and again on completion/failure.

Structs§

StreamingCommandResult
Summary of a streaming command execution.

Enums§

ShellRuntimeFailureKind
Runtime classification for why a shell command was interrupted or timed out.

Functions§

execute_streaming
Spawn a shell command and stream its output.
get_rerun_info
Retrieve info needed to re-run a command (from a previous process_id). Returns (command, cwd, env, timeout_secs) if the process was registered.
pause_process
Send SIGSTOP (pause) to a running shell process.
resume_process
Send SIGCONT (resume) to a paused shell process.
stop_process
Send SIGTERM to a running shell process, then SIGKILL after 3 s.