Skip to main content

run_shell_io_loop_with_handle

Function run_shell_io_loop_with_handle 

Source
pub async fn run_shell_io_loop_with_handle(
    channel_id: ChannelId,
    pty: Arc<RwLock<PtyMaster>>,
    child: Option<Child>,
    handle: Handle,
    data_rx: Receiver<Vec<u8>>,
) -> i32
Expand description

Run shell I/O loop using Handle for output (instead of ChannelStream).

This version spawns a separate task for PTY-to-SSH streaming, similar to how exec does it. handle.data() is called from the spawned task, not directly from the handler’s await chain.

§Arguments

  • channel_id - The SSH channel ID
  • pty - The PTY master handle
  • child - The shell child process (optional)
  • handle - The russh Handle for sending data
  • data_rx - Receiver for incoming data from SSH client

§Returns

Returns the exit code of the shell process.