# tmux_window_link:move/3

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

```
move(Link, Session, Options)
-spec move(tmux_model:window_link(),
           tmux_model:session(),
           placement_options()) ->
              {ok, tmux_operation:completed()} |
              {error, tmux_operation:failure()}.
```

Move this membership to the destination session and explicit index, leaving its physical window's other links intact. Placement options follow `link/3`. Moving the final window out of a session can destroy that session; automatic renumbering and session groups can change other memberships. Captured rows remain unchanged. Returns the command result after observed preflight.

## Parameters

- `Link` (`tmux_model:window_link()`)
- `Session` (`tmux_model:session()`)
- `Options` (`placement_options()`)

## tmux command

The tmux commands behind `move/3`.

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

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_move_window_entry`](/en/tmux/latest/reference/c-variable-cmd_move_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

Move a window to another session or index

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.move_window`](/en/py/latest/reference/libtmux-window-move_window/) (method) |
| Lua | [`libtmux.WindowLink:move`](/en/lua/latest/reference/libtmux-windowlink-move/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`window.Window.move`](/en/ts/latest/reference/window-window-move/) (method) |
| Rust | [`window.Window.move_to`](/en/rs/latest/reference/window-window-move_to/) (method) |
| Go | [`tmux.Window.Move`](/en/go/latest/reference/tmux-window-move/) (method) |
| Java | [`io.github.libtmux.Window.moveTo`](/en/java/latest/reference/io-github-libtmux-window-window-moveto/) (method) |
| C# | [`LibTmux.Window.MoveAsync`](/en/csharp/latest/reference/libtmux-window-moveasync/) (method) |
| C++ | [`libtmux::Window::move_to`](/en/cxx/latest/reference/libtmux-window-move_to/) (method) |
| Swift | [`Server.move(_:to:at:)`](/en/swift/latest/reference/server-move(_-to-at-)/) (method) |
| OCaml | [`Libtmux_unix.Client.move_window_at`](/en/ocaml/latest/reference/libtmux_unix-client-move_window_at/) (function) |
| Perl | [`LibTmux::Server::move_window`](/en/perl/latest/reference/libtmux-server-move_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#.
