# libtmux.Server.wait_for

- **Module:** libtmux.Server
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/9fdd083a8181a827889337b63cd4e6daea661a8c/src/libtmux/server.py#L620
- **Page:** https://libtmux.org/en/py/latest/reference/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)
```
