# LibTmux.move_window

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/topology.jl#L149
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-move_window/

```
move_window(
    connection::LibTmux.ControlConnection,
    source::LibTmux.WindowLinkRef,
    destination::LibTmux.SessionRef;
    index,
    replace,
    select,
    kwargs...
)

move_window(
    server::LibTmux.Server,
    source::LibTmux.WindowLinkRef,
    destination::LibTmux.SessionRef;
    index,
    replace,
    select,
    kwargs...
)
```

## Methods

### `move_window` (overload 1)

```julia
move_window(
    connection::LibTmux.ControlConnection,
    source::LibTmux.WindowLinkRef,
    destination::LibTmux.SessionRef;
    index,
    replace,
    select,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control_topology.jl#L264).

Execute `move-window` with explicit source and destination session/index slots. Replacement and selection follow the subprocess method. The daemon generation is pinned, but a link's index/window membership is checked before submission and can change concurrently. This does not reserve a topology transaction. Repeated links to one physical window retain their separate slot semantics. Return `ControlResult`; no fallback or replay occurs.

```julia
move_window(connection::ControlConnection, source::WindowLinkRef, destination::SessionRef; index, kwargs...)
```

### `move_window` (overload 2)

```julia
move_window(
    server::LibTmux.Server,
    source::LibTmux.WindowLinkRef,
    destination::LibTmux.SessionRef;
    index,
    replace,
    select,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/topology.jl#L157).

Move only the specified source link to an explicit destination index. Other links to the physical window remain. Replacement and selection follow `link_window`; moving a session's final link may end that session.

```julia
move_window(server, source::WindowLinkRef, destination::SessionRef;
            index, replace=false, select=false, kwargs...)
```

## Parameters

- `connection` (`LibTmux.ControlConnection`) (for `move_window(connection, source, destination, index, replace, select, kwargs)`)
- `source` (`LibTmux.WindowLinkRef`)
- `destination` (`LibTmux.SessionRef`)
- `index` (`Integer`)
- `replace` (`Bool`)
  Default: `false`.
- `select` (`Bool`)
  Default: `false`.
- `kwargs`
- `server` (`LibTmux.Server`) (for `move_window(server, source, destination, index, replace, select, kwargs)`)
