# LibTmux.Window.SwapAsync

- **Module:** LibTmux.Window
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Window.Links.cs#L143
- **Page:** https://libtmux.org/reference/dotnet/libtmux-window-swapasync/

```
LibTmux.Window.SwapAsync(target: WindowId, detach: bool, cancellationToken: CancellationToken) -> Task
```

Swaps this window with another.

A window linked into several sessions resolves to whichever link tmux
picks, because a window identifier does not name one.

## Parameters

- `target` (WindowId) — The window to swap with.
- `detach` (bool) — Whether the swapped window is left unselected.
- `cancellationToken` (CancellationToken) — Cancels the tmux command.
