# tmux.Running.Wait

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

```
tmux.Running.Wait(ctx: context.Context) -> (RunResult, error)
```

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.

Wait may be called more than once and concurrently; every call observes the
same completion. The outcome is read once, as soon as any call sees the
command end, on a context no caller's cancellation reaches, because from
then on it belongs to every caller. A call whose context ends first reports
that context and leaves the window alone; a later call gets the outcome.
