tmux.Running.StreamTo
Go
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- tmux
- Declared in
- Running
- Package
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/session_run.go
-
StreamTo copies what the command prints into destination as it prints it and then reports how it ended, so following a command and collecting its outcome are one blocking call rather than a goroutine the caller writes. It returns exactly what
Running.Waitreturns and, like Wait, removes the window unlessRunOptions.Keepwas set. destination is written only by this call, so it needs no synchronization of its own, andRunning.Killmay be called from another goroutine while it runs.The stream is what tmux pushed, which is not quite everything: output the command printed before StreamTo opened its observation may or may not be in it, and tmux can drop a line printed with nothing between it and the command's exit.
RunResult.Linesis a screen capture rather than a notification stream and remains the authoritative record of what the command showed. Streaming needs a control client, which aConnection-bound value does not have, so it returnsErrConnectionRequiresProcessthere; Wait alone does not.
0 declared, 0 inherited