# LibTmux.Window.SwapAsync

- **Module:** LibTmux.Window
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Window.Links.cs#L135
- **Page:** https://libtmux.org/en/dotnet/latest/reference/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.
