# tmux.Poll

- **Module:** tmux
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/poll.go#L21
- **Page:** https://libtmux.org/reference/go/tmux-poll/

```
tmux.Poll(ctx: context.Context, interval: time.Duration, condition: func(context.Context) (bool, error)) -> error
```

Poll checks condition immediately and then after each interval, until it reports true, returns an error, or ctx ends.

A condition receives ctx and must observe cancellation itself; Poll cannot
interrupt one already running. Poll returns condition errors unchanged and
ctx.Err when ctx ends first. Use Poll to wait for pane output;
[Server.WaitFor] signals tmux's separate wait-for channel.
