tmux.Running
Go
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- tmux
- Package
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/session_run.go
-
Running is a command started by
Session.Start: a real process, already under way, in a pane of its own.Running.Paneexposes that pane so its output can be streamed withPane.OpenObservationor typed into withPane.Writerwhile the command runs;Running.WaitandRunning.Killwait for and stop it. A line printed with nothing separating it from the command's own exit can race tmux's control-mode notification of it and never reachPaneObservation.Reader;RunResult.Linesfrom Wait, a plain screen capture rather than that notification stream, always has it.
4 declared, 0 inherited
Members
- Kill method Kill asks the tmux server to send SIGKILL to the process group running the command. It does not wait for the process to stop; call Wait to observe the resulting status or signal.
- Pane method Pane returns the pane the command runs in, materialized immediately after Start returned. Like any materialized record it does not refresh itself; a call after Wait or Kill may no longer describe a live pane.
- StreamTo method 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. - Wait method Wait blocks until the command exits, on tmux's own wait-for signal backed by a widening liveness check, and reports its exit status and what its terminal showed. It removes the window Start created unless
RunOptions.Keepwas set. A command whose process tmux never reaps has no outcome to report, and Wait ends withErrOutcomeUnrecordedrather than the zero status that would make a failed command look successful.