pane.Pane.stream_output
Rust
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- pane
- Declared in
- Pane
- Package
- libtmux
- Source
- crates/libtmux/src/pane/observe.rs
-
Watch what this pane writes, as it writes it.
Pane::capturereads what is on screen now; this reports every byte the pane produces from here on, including what scrolls away. It opens a control-mode connection to the session holding the pane and keeps it, so there is no polling and no sampling interval to get wrong. Where the pane lives is resolved here rather than taken from this handle.The bytes are the pane's own, terminal escapes included. tmux reports them in whatever sized chunks it has, so a caller wanting lines has to buffer.
Keep reading, or the pane stops. Events are handed over with backpressure rather than dropped, so a stream left unread stops the connection reading from tmux, and tmux stops the pane that is filling it. A caller who wants to stop watching calls
PaneOutput::shutdownrather than leaving the handle idle.tmux discards what a pane has buffered when the pane exits, so a command that writes and returns immediately may be reported as nothing at all.
Errors
Returns
Error::ObjectGonewhen the pane no longer exists, a listing error when tmux could not be read, or an error when the control-mode connection cannot be opened.Cancel safety
Nothing is left held: a dropped call closes the connection it opened, and the mutes it set end with that connection.
Examples
let mut output = pane.stream_output().await?;while let Some(chunk) = output.next_chunk().await {println!("{} bytes", chunk.len());}output.shutdown().await
0 declared, 0 inherited