# LibTmux.swap_pane

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/topology.jl#L208
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-swap_pane/

```
swap_pane(
    connection::LibTmux.ControlConnection,
    first::LibTmux.PaneRef,
    second::LibTmux.PaneRef;
    select,
    kwargs...
)

swap_pane(
    server::LibTmux.Server,
    first::LibTmux.PaneRef,
    second::LibTmux.PaneRef;
    select,
    kwargs...
)
```

## Methods

### `swap_pane` (overload 1)

```julia
swap_pane(
    connection::LibTmux.ControlConnection,
    first::LibTmux.PaneRef,
    second::LibTmux.PaneRef;
    select,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control_topology.jl#L203).

Swap exact panes over the pinned connection, preserving IDs and running processes.

### `swap_pane` (overload 2)

```julia
swap_pane(
    server::LibTmux.Server,
    first::LibTmux.PaneRef,
    second::LibTmux.PaneRef;
    select,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/topology.jl#L209).

Swap two physical panes, preserving their IDs and running processes.

## Parameters

- `connection` (`LibTmux.ControlConnection`) (for `swap_pane(connection, first, second, select, kwargs)`)
- `first` (`LibTmux.PaneRef`)
- `second` (`LibTmux.PaneRef`)
- `select` (`Bool`)
  Default: `false`.
- `kwargs`
- `server` (`LibTmux.Server`) (for `swap_pane(server, first, second, select, kwargs)`)
