# LibTmux::Model::WindowLinkRef.swap

- **Module:** LibTmux::Model
- **Package:** LibTmux
- **Language:** Raku
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-raku/blob/0b5dd3d32e20f83a0069874e33eab0eb48f55962/lib/LibTmux/Model.rakumod#L557
- **Page:** https://libtmux.org/en/raku/latest/reference/libtmux-model-windowlinkref-swap/

```
method swap(WindowLinkRef:D $other, Bool :$select = False --> Result:D)
```

Swap the two verified pane identities or session-relative window placements.

Swap the two verified pane identities or session-relative window placements.

## Parameters

- `$other` (`WindowLinkRef:D`)
- `$select?` (`Bool`)

## tmux command

The tmux commands behind `swap`.

- [`swap-window`](/en/tmux/latest/manual/swap-window/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_swap_window_entry`](/en/tmux/latest/reference/c-variable-cmd_swap_window_entry/) (attribute)
- [`cmd_swap_window_exec`](/en/tmux/latest/reference/c-function-cmd-swap-window-c-cmd_swap_window_exec/) (function)

## In other ports

Exchange two windows

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.swap`](/en/py/latest/reference/libtmux-window-swap/) (method) |
| Lua | [`libtmux.WindowLink:swap`](/en/lua/latest/reference/libtmux-windowlink-swap/) (method) |
| Erlang | [`tmux_window_link:swap/3`](/en/erlang/latest/reference/tmux_window_link-swap-3/) (function) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`window.Window.swapWith`](/en/ts/latest/reference/window-window-swapwith/) (method) |
| Rust | [`window.Window.swap_with`](/en/rs/latest/reference/window-window-swap_with/) (method) |
| Go | [`tmux.Window.Swap`](/en/go/latest/reference/tmux-window-swap/) (method) |
| Java | no equivalent on `Window` |
| C# | [`LibTmux.Window.SwapAsync`](/en/csharp/latest/reference/libtmux-window-swapasync/) (method) |
| C++ | [`libtmux::Window::swap_with`](/en/cxx/latest/reference/libtmux-window-swap_with/) (method) |
| Swift | [`Server.swap(_:with:)`](/en/swift/latest/reference/server-swap(_-with-)/) (method) |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |

No equivalent is recorded in Ruby, PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.
