# libtmux.Window.move_window

- **Module:** libtmux.Window
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/window.py#L1461
- **Page:** https://libtmux.org/reference/py/libtmux-window-move_window/

```
libtmux.Window.move_window(self, destination: str = "", session: str | None = None, after: bool | None = None, before: bool | None = None, no_select: bool | None = None, kill_target: bool | None = None, renumber: bool | None = None) -> Window
```

Move current :class:`Window` object ``$ tmux move-window``.

## Parameters

- `self`
- `destination` (str) — The ``target window`` or index to move the window to, default:
empty string.
- `session` (str | None) — The ``target session`` or index to move the window to, default:
current session.
- `after` (bool | None) — Insert after the target window (``-a`` flag).
- `before` (bool | None) — Insert before the target window (``-b`` flag).
- `no_select` (bool | None) — Do not make the moved window the current window (``-d`` flag).
- `kill_target` (bool | None) — Kill the target window if it exists (``-k`` flag).
- `renumber` (bool | None) — Renumber all windows in sequential order (``-r`` flag). This is a
standalone operation — when used, no move is performed and other
parameters are ignored.

## Returns

:class:`Window`
    Self, for method chaining.

## Raises

- `libtmux.exc.LibTmuxException` — If tmux returns an error.
