# libtmux.Pane.from_pane_id

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/pane.py#L167
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-pane-from_pane_id/

```
libtmux.Pane.from_pane_id(
    cls, server: Server, pane_id: str
) -> Pane
```

Create Pane from existing pane_id.

tmux's ``cmd_find`` routes a ``-t`` target by *sigil*, so a ``%``-id
handed to [`list-panes`](/en/tmux/latest/manual/list-panes/) resolves to that pane's window and lists it.
Every row comes back stamped with the session tmux considers canonical
for that window -- the most recently active one -- which is the same
session [`display-message`](/en/tmux/latest/manual/display-message/)` -t %ID '#{`[`session_id`](/en/tmux/latest/catalog/formats/session_id/)`}'` reports. A window
linked into several sessions therefore gets one authoritative answer
instead of "whichever session sorted last".

## Examples

```python
>>> Pane.from_pane_id(server=pane.server, pane_id=pane.pane_id)
Pane(%1 Window(@1 1:..., Session($1 ...)))
```

## Parameters

- `server` (`Server`): The tmux server holding the pane.
- `pane_id` (`str`): Pane id, e.g. ``"%3"``.

## Returns

:class:`Pane`

## Raises

- [`TmuxObjectDoesNotExist`](/en/py/stable/reference/libtmux-exc-tmuxobjectdoesnotexist/): When no such pane exists on a reachable server.
- [`LibTmuxException`](/en/py/stable/reference/libtmux-exc-libtmuxexception/): When tmux itself is unreachable.
