# LibTmux.unlink_window

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/topology.jl#L129
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-unlink_window/

```
unlink_window(
    connection::LibTmux.ControlConnection,
    target::LibTmux.WindowLinkRef;
    allow_destroy,
    kwargs...
)

unlink_window(
    server::LibTmux.Server,
    target::LibTmux.WindowLinkRef;
    allow_destroy,
    kwargs...
)
```

## Methods

### `unlink_window` (overload 1)

```julia
unlink_window(
    connection::LibTmux.ControlConnection,
    target::LibTmux.WindowLinkRef;
    allow_destroy,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control_topology.jl#L308).

Remove the checked session/index link. Its last physical-window link is protected unless `allow_destroy=true`. Membership checks are observational and may race other clients; the daemon generation remains pinned. Return `ControlResult`.

```julia
unlink_window(connection::ControlConnection, link::WindowLinkRef; allow_destroy=false, kwargs...)
```

### `unlink_window` (overload 2)

```julia
unlink_window(
    server::LibTmux.Server,
    target::LibTmux.WindowLinkRef;
    allow_destroy,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/topology.jl#L136).

Remove exactly one captured session/index link. The last link is protected unless `allow_destroy=true`; removing it destroys the physical window and may end its session. Return the command result.

```julia
unlink_window(server, target::WindowLinkRef; allow_destroy=false, kwargs...)
```

## Parameters

- `connection` (`LibTmux.ControlConnection`) (for `unlink_window(connection, target, allow_destroy, kwargs)`)
- `target` (`LibTmux.WindowLinkRef`)
- `allow_destroy` (`Bool`)
  Default: `false`.
- `kwargs`
- `server` (`LibTmux.Server`) (for `unlink_window(server, target, allow_destroy, kwargs)`)
