# LibTmux.Window.SwapAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Window.Links.cs#L153
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-window-swapasync/

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

```
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.
