# libtmux.Server._session_target

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/efdbb5637666b166358772ecc737b3807beab21e/src/libtmux/server.py#L1220
- **Page:** https://libtmux.org/en/py/latest/reference/libtmux-server-_session_target/

```
libtmux.Server._session_target(
    self, target_session: str | int, exact: bool | None
) -> str | int
```

Return the tmux target for a session name, honouring ``exact``.

``exact=True`` always sends ``=name``; ``exact=False`` sends the bare
name and keeps tmux's exact, prefix, then ``fnmatch(3)`` resolution.
``exact=None`` behaves like ``False`` and warns only when the bare name
has no exact match but tmux would still resolve it.

## Parameters

- `target_session` (`str | int`)
- `exact` (`bool | None`)
