# cmd_swap_pane_exec

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L46
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-cmd-swap-pane-c-cmd_swap_pane_exec/

tmux command: [`swap-pane`](/en/tmux/3.2a/manual/swap-pane/)

```c
static enum cmd_retval cmd_swap_pane_exec(struct cmd *, struct cmdq_item *)
```

## Parameters

- `self` (`struct cmd *`)
- `item` (`struct cmdq_item *`)

## Calls

- [`args_has`](/en/tmux/3.2a/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L64)
- [`cmd_get_args`](/en/tmux/3.2a/reference/c-function-cmd_get_args/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L48)
- [`cmdq_get_source`](/en/tmux/3.2a/reference/c-function-cmdq_get_source/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L49)
- [`cmdq_get_target`](/en/tmux/3.2a/reference/c-function-cmdq_get_target/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L50)
- [`options_set_parent`](/en/tmux/3.2a/reference/c-function-options_set_parent/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L103)
- [`server_client_remove_pane`](/en/tmux/3.2a/reference/c-function-server_client_remove_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L82)
- [`server_redraw_window`](/en/tmux/3.2a/reference/c-function-server_redraw_window/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L62)
- [`window_pop_zoom`](/en/tmux/3.2a/reference/c-function-window_pop_zoom/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L140)
- [`window_push_zoom`](/en/tmux/3.2a/reference/c-function-window_push_zoom/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L61)
- [`window_set_active_pane`](/en/tmux/3.2a/reference/c-function-window_set_active_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-swap-pane.c#L118)

## Referenced by

- [`cmd_swap_pane_entry`](/en/tmux/3.2a/reference/c-variable-cmd_swap_pane_entry/) (attribute)

## Referenced declarations

- [`window.active`](/en/tmux/3.2a/reference/c-struct-window-active/) (attribute)
- [`cmd`](/en/tmux/3.2a/reference/c-struct-cmd/) (struct)
- [`CMD_RETURN_NORMAL`](/en/tmux/3.2a/reference/c-enum-cmd_retval-cmd_return_normal/) (constant)
- [`cmd_retval`](/en/tmux/3.2a/reference/c-enum-cmd_retval/) (enum)
- [`cmdq_item`](/en/tmux/3.2a/reference/c-struct-cmdq_item/) (struct)
- [`layout_cell.entry`](/en/tmux/3.2a/reference/c-struct-layout_cell-entry/) (attribute)
- [`window_pane.flags`](/en/tmux/3.2a/reference/c-struct-window_pane-flags/) (attribute)
- [`window.last`](/en/tmux/3.2a/reference/c-struct-window-last/) (attribute)
- [`window_pane.layout_cell`](/en/tmux/3.2a/reference/c-struct-window_pane-layout_cell/) (attribute)
- [`window_pane.options`](/en/tmux/3.2a/reference/c-struct-window_pane-options/) (attribute)
- [`window.options`](/en/tmux/3.2a/reference/c-struct-window-options/) (attribute)
- [`PANE_STYLECHANGED`](/en/tmux/3.2a/reference/c-define-tmux-h-pane_stylechanged/) (constant)
- [`window.panes`](/en/tmux/3.2a/reference/c-struct-window-panes/) (attribute)
- [`layout_cell.sx`](/en/tmux/3.2a/reference/c-struct-layout_cell-sx/) (attribute)
- [`window_pane.sx`](/en/tmux/3.2a/reference/c-struct-window_pane-sx/) (attribute)
- [`layout_cell.sy`](/en/tmux/3.2a/reference/c-struct-layout_cell-sy/) (attribute)
- [`window_pane.sy`](/en/tmux/3.2a/reference/c-struct-window_pane-sy/) (attribute)
- [`window_pane.window`](/en/tmux/3.2a/reference/c-struct-window_pane-window/) (attribute)
- [`winlink.window`](/en/tmux/3.2a/reference/c-struct-winlink-window/) (attribute)
- [`cmd_find_state.wl`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-wl/) (attribute)
- [`cmd_find_state.wp`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-wp/) (attribute)
- [`layout_cell.wp`](/en/tmux/3.2a/reference/c-struct-layout_cell-wp/) (attribute)
- [`layout_cell.xoff`](/en/tmux/3.2a/reference/c-struct-layout_cell-xoff/) (attribute)
- [`window_pane.xoff`](/en/tmux/3.2a/reference/c-struct-window_pane-xoff/) (attribute)
- [`layout_cell.yoff`](/en/tmux/3.2a/reference/c-struct-layout_cell-yoff/) (attribute)
- [`window_pane.yoff`](/en/tmux/3.2a/reference/c-struct-window_pane-yoff/) (attribute)
