# window.Window.link

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

```
link(options: MoveWindowOptions): Promise<void>
```

Link this window into another session, giving it a second placement.

## Examples

```ts
await window.link({ session: "other" });
```

## Parameters

- `options` (`MoveWindowOptions`)

## tmux command

The tmux commands behind `link`.

- [`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)

## In other ports

Link a window into another session

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.link`](/en/py/latest/reference/libtmux-window-link/) (method) |
| Ruby | [`LibTmux::Session#link_window`](/en/ruby/latest/reference/libtmux-session-link_window/) (method) |
| Lua | [`libtmux.WindowLink:link`](/en/lua/latest/reference/libtmux-windowlink-link/) (method) |
| Rust | [`window.Window.link_to`](/en/rs/latest/reference/window-window-link_to/) (method) |
| Go | [`tmux.Window.Link`](/en/go/latest/reference/tmux-window-link/) (method) |
| Java | [`io.github.libtmux.Window.linkTo`](/en/java/latest/reference/io-github-libtmux-window-window-linkto/) (method) |
| C# | [`LibTmux.Window.LinkAsync`](/en/csharp/latest/reference/libtmux-window-linkasync/) (method) |
| C++ | [`libtmux::Window::link_to`](/en/cxx/latest/reference/libtmux-window-link_to/) (method) |
| Swift | [`Server.link(_:into:)`](/en/swift/latest/reference/server-link(_-into-)/) (method) |

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