# libtmux.Pane.select

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

tmux command: [`select-pane`](/en/tmux/latest/manual/select-pane/)

```
libtmux.Pane.select(
    self,
    direction: ResizeAdjustmentDirection | None = None,
    last: bool | None = None,
    keep_zoom: bool | None = None,
    mark: bool | None = None,
    clear_mark: bool | None = None,
    disable_input: bool | None = None,
    enable_input: bool | None = None,
) -> Pane
```

Select pane.

## Examples

```python
>>> pane = window.active_pane
>>> new_pane = window.split()
>>> pane.refresh()
>>> active_panes = [p for p in window.panes if p.pane_active == '1']
```

```python
>>> pane in active_panes
True
>>> new_pane in active_panes
False
```

```python
>>> new_pane.pane_active == '1'
False
```

```python
>>> new_pane.select()
Pane(...)
```

```python
>>> new_pane.pane_active == '1'
True
```

## Parameters

- `direction` (`ResizeAdjustmentDirection | None`): Select the pane in the given direction (``-U``, ``-D``, ``-L``,
``-R``). (added 0.56)
- `last` (`bool | None`): Select the last (previously selected) pane (``-l`` flag). (added 0.56)
- `keep_zoom` (`bool | None`): Keep the window zoomed if it was zoomed (``-Z`` flag). (added 0.56)
- `mark` (`bool | None`): Set the marked pane (``-m`` flag). (added 0.56)
- `clear_mark` (`bool | None`): Clear the marked pane (``-M`` flag). (added 0.56)
- `disable_input` (`bool | None`): Disable input to the pane (``-d`` flag). (added 0.56)
- `enable_input` (`bool | None`): Enable input to the pane (``-e`` flag). (added 0.56)

## Returns

:class:`Pane`
    Self, for method chaining.

## In other ports

### Make a pane active

- Ruby: [`LibTmux::Pane#select`](/en/ruby/latest/reference/libtmux-pane-select/) (method)
- Lua: [`libtmux.Pane:select`](/en/lua/latest/reference/libtmux-pane-select/) (method)
- TypeScript: [`pane.Pane.select`](/en/ts/latest/reference/pane-pane-select/) (method)
- Rust: [`pane.Pane.select`](/en/rs/latest/reference/pane-pane-select/) (method)
- Go: [`tmux.Pane.Select`](/en/go/latest/reference/tmux-pane-select/) (method)
- Java: [`io.github.libtmux.Pane.Pane.select`](/en/java/latest/reference/io-github-libtmux-pane-pane-select/) (method)
- C#: [`LibTmux.Pane.SelectAsync`](/en/csharp/latest/reference/libtmux-pane-selectasync/) (method)
- C++: [`libtmux::Pane::select`](/en/cxx/latest/reference/libtmux-pane-select/) (method)
- Swift: [`Server.select(_:)`](/en/swift/latest/reference/server-select(_-)/) (method)
