# tmux_window_link:unlink/2

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_window_link.erl#L128
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_window_link-unlink-2/

```
unlink(Link, Options)
-spec unlink(tmux_model:window_link(), unlink_options()) ->
                {ok, tmux_operation:completed()} |
                {error, tmux_operation:failure()}.
```

Remove one checked membership. force defaults false, retaining tmux's protection for windows linked to only one session. force = true permits removing the last link, destroying that physical window and possibly its session. Duplicate links within one session retain tmux's native protection rules. Performs I/O and returns the command result without refreshing rows.

## Parameters

- `Link` (`tmux_model:window_link()`)
- `Options` (`unlink_options()`)

## tmux command

The tmux commands behind `unlink/2`.

- [`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) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`window.Window.unlink`](/en/ts/latest/reference/window-window-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) |
| OCaml | [`Libtmux_unix.Client.unlink_window_at`](/en/ocaml/latest/reference/libtmux_unix-client-unlink_window_at/) (function) |
| Perl | [`LibTmux::Server::unlink_window`](/en/perl/latest/reference/libtmux-server-unlink_window/) (method). Requires an explicit WindowLink or session_id:index context; a physical window alone does not select a session placement. |

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