# libtmux.Server.wait_for

- **Module:** libtmux.Server
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/server.py#L620
- **Page:** https://libtmux.org/reference/py/libtmux-server-wait_for/

```
libtmux.Server.wait_for(self, channel: str, lock: bool | None = None, unlock: bool | None = None, set_flag: bool | None = None) -> None
```

Wait for, signal, or lock a channel via ``$ tmux wait-for``.

## Parameters

- `self`
- `channel` (str) — Channel name.
- `lock` (bool | None) — Lock the channel (``-L`` flag).
- `unlock` (bool | None) — Unlock the channel (``-U`` flag).
- `set_flag` (bool | None) — Set the channel flag and wake waiters (``-S`` flag).

## Example

```python
>>> server.new_session(session_name='wait_test')
Session(...)
>>> server.wait_for('test_channel', set_flag=True)
```
