# window.Window.unlink

- **Module:** window
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/window.ts#L460
- **Page:** https://libtmux.org/en/ts/latest/reference/window-window-unlink/

```
unlink(): Promise<void>
```

Remove this placement, leaving the window's other placements intact.

For a window linked into several sessions. A window shared because its
sessions are grouped is not linked, and tmux refuses with "window only
linked to one session" — a group member leaves by being killed, not by
unlinking.

## Examples

```ts
const destination = await server.newSession({ name: "unlink-example" });
await window.link({ session: destination.id });
const placement = (await server.snapshot()).windows.one({
  id: window.id,
  session: { is: { id: destination.id } },
});
await placement.unlink();
```

## tmux command

The tmux commands behind `unlink`.

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

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_unlink_window_entry`](/en/tmux/latest/reference/c-variable-cmd_unlink_window_entry/) (attribute)
- [`cmd_kill_window_exec`](/en/tmux/latest/reference/c-function-cmd-kill-window-c-cmd_kill_window_exec/) (function)

## In other ports

Unlink a window from a session

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.unlink`](/en/py/latest/reference/libtmux-window-unlink/) (method) |
| Lua | [`libtmux.WindowLink:unlink`](/en/lua/latest/reference/libtmux-windowlink-unlink/) (method) |
| Rust | [`window.Window.unlink`](/en/rs/latest/reference/window-window-unlink/) (method) |
| Go | [`tmux.Window.Unlink`](/en/go/latest/reference/tmux-window-unlink/) (method) |
| Java | [`io.github.libtmux.Window.unlink`](/en/java/latest/reference/io-github-libtmux-window-window-unlink/) (method) |
| C# | [`LibTmux.Window.UnlinkAsync`](/en/csharp/latest/reference/libtmux-window-unlinkasync/) (method) |
| C++ | [`libtmux::Window::unlink`](/en/cxx/latest/reference/libtmux-window-unlink/) (method) |
| Swift | [`Server.unlink(_:)`](/en/swift/latest/reference/server-unlink(_-)/) (method) |

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