# libtmux_mcp.prompts.recipes.run_and_wait

- **Module:** libtmux_mcp.prompts.recipes
- **Package:** libtmux-mcp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/prompts/recipes.py#L14
- **Page:** https://libtmux.org/en/py/latest/mcp/reference/libtmux_mcp-prompts-recipes-run_and_wait/

```
libtmux_mcp.prompts.recipes.run_and_wait(command: str, pane_id: str, timeout: float = 60.0) -> str
```

Run a shell command in a tmux pane and wait for completion.

The returned template teaches the high-level authored-command
primitive: ``run_command`` sends the command, waits through a
private tmux signal, captures output, and reports exit status in
one typed result. Use lower-level ``send_keys`` +
``wait_for_channel`` only when the caller needs custom shell
composition outside this common command-completion shape.

## Parameters

- `command` (str): The shell command to run.
- `pane_id` (str): Target pane (e.g. ``%1``).
- `timeout` (float): Maximum seconds to wait for command completion. Default 60.
