# libtmux:link-window

- **Package:** libtmux
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/placement.lisp#L42
- **Public owner:** libtmux
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-link-window/

```
(link-window client source-link session index &key (detached t) (observe t) cancel-token timeout output-limit)
```

Link SOURCE-LINK's physical window into SESSION at the free INDEX.
Return a COMMAND-OUTCOME with the new window link when OBSERVE is true.
SOURCE-LINK preserves the source session context, including tmux group rules.
DETACHED defaults true. Never overwrites an occupied index. Signals STALE-TARGET
or an operational condition; observation failure is retained separately.

## Parameters

- `client`
- `source-link`
- `session`
- `index`
- `detached?`
- `observe?`
- `cancel-token?`
- `timeout?`
- `output-limit?`

## tmux command

The tmux commands behind `link-window`.

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

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_link_window_entry`](/en/tmux/latest/reference/c-variable-cmd_link_window_entry/) (attribute)
- [`cmd_move_window_exec`](/en/tmux/latest/reference/c-function-cmd-move-window-c-cmd_move_window_exec/) (function)

## Guides

Pages that discuss `link-window`.

- [Explicit operations](/en/lisp/latest/guides/operations/)
