Skip to main content

forward_process_output

Function forward_process_output 

Source
pub async fn forward_process_output(
    process: PaneProcess,
    client: &TuiClient,
    signing_key: &SigningKey,
    viewer_id: u32,
    _pane_id: u32,
    initial_cols: u16,
    initial_rows: u16,
    stdin_stream: Option<&StreamInfo>,
) -> Result<()>
Expand description

Forward process output to the TUI service via sendInput RPC calls.

Runs a resize polling task concurrently: every ~1s, queries the pane size via list_windows RPC. If the size changed (e.g. a browser viewer connected), sends ProcessInput::Resize to the local PaneProcess so the AnsiBackend matches the new pane dimensions.

If stdin_stream is provided (FD 0 from ConnectResult), subscribes to the PUB/SUB stream for relayed viewer input (keypresses from browser or tui-attach viewers) and forwards them to the local PaneProcess.