# libtmux_mcp.tools.session_tools.select_window

- **Module:** libtmux_mcp.tools.session_tools
- **Package:** libtmux-mcp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/session_tools.py#L280
- **Page:** https://libtmux.org/en/py/stable/mcp/reference/libtmux_mcp-tools-session_tools-select_window/

```
libtmux_mcp.tools.session_tools.select_window(
    window_id: str | None = None,
    window_index: str | None = None,
    direction: t.Literal["next", "previous", "last"]
    | None = None,
    session_name: str | None = None,
    session_id: str | None = None,
    socket_name: str | None = None,
) -> WindowInfo
```

Select (focus) a tmux window by ID, index, or direction.

Use to navigate between windows. Provide window_id or window_index
for direct selection, or direction for relative navigation.

## Parameters

- `window_id` (`str | None`): Window ID (e.g. '@1') for direct selection.
- `window_index` (`str | None`): Window index for direct selection.
- `direction` (`t.Literal["next", "previous", "last"] | None`): Relative direction: 'next', 'previous', or 'last'.
- `session_name` (`str | None`): Session name for resolution.
- `session_id` (`str | None`): Session ID for resolution.
- `socket_name` (`str | None`): tmux socket name.

## Returns

WindowInfo
    The now-active window.
