# tmux.Running

- **Module:** tmux
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/session_run.go#L192
- **Page:** https://libtmux.org/en/go/latest/reference/tmux-running/

Running is a command started by [Session.Start]: a real process, already under way, in a pane of its own. [Running.Pane] exposes that pane so its output can be streamed with [Pane.OpenObservation] or typed into with [Pane.Writer] while the command runs; [Running.Wait] and [Running.Kill] wait 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 reach [PaneObservation.Reader]; [RunResult.Lines] from Wait, a plain screen capture rather than that notification stream, always has it.

## Members

- `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.
- `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.Keep] was set. A command whose process tmux never reaps has no outcome to report, and Wait ends with [ErrOutcomeUnrecorded] rather than the zero status that would make a failed command look successful.
- `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.Wait] returns and, like Wait, removes the window unless [RunOptions.Keep] was set. destination is written only by this call, so it needs no synchronization of its own, and [Running.Kill] may be called from another goroutine while it runs.
- `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.
