# LibTmux::Server::move_window

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Perl
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-perl/blob/352715a4fa66a96eed7763b90daaa536aa2f121d/packages/core/lib/LibTmux/Server.pm#L1026
- **Page:** https://libtmux.org/en/perl/latest/reference/libtmux-server-move_window/

```
sub move_window($self, %args)
```

`move_window(link => WindowLink|session_id:index, session => Session|session_id, index => integer?)`.

Move one contextual [`LibTmux::WindowLink`](/en/perl/latest/reference/libtmux-windowlink/) into the destination session/index. Other links of the physical window keep their own associations. Use [`"link_window"`](/en/perl/latest/reference/libtmux-server-link_window/) to add an association without moving one.

Returns `undef` after command acceptance. Performs I/O; failures propagate through [`LibTmux::X`](/en/perl/latest/reference/libtmux-x/). Captured objects are not modified.


```perl
    $server->move_window(link => $link, session => $session, index => 4);
```

## Methods

## Parameters

- `args`

## tmux command

The tmux commands behind `move_window`.

- [`display-message`](/en/tmux/latest/manual/display-message/) (daemon identity or target preflight)
- [`move-window`](/en/tmux/latest/manual/move-window/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_display_message_entry`](/en/tmux/latest/reference/c-variable-cmd_display_message_entry/) (attribute)
- [`cmd_display_message_exec`](/en/tmux/latest/reference/c-function-cmd-display-message-c-cmd_display_message_exec/) (function)
- [`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) |
| Erlang | [`tmux_window_link:move/3`](/en/erlang/latest/reference/tmux_window_link-move-3/) (function) |
| 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) |

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