# LibTmux.split_window

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

```
split_window(
    connection::LibTmux.ControlConnection,
    target::LibTmux.PaneRef;
    direction,
    command,
    shell_command,
    start_directory,
    size,
    environment,
    kwargs...
)

split_window(
    server::LibTmux.Server,
    target::LibTmux.PaneRef;
    direction,
    command,
    shell_command,
    start_directory,
    size,
    environment,
    kwargs...
)
```

## Methods

### `split_window` (overload 1)

```julia
split_window(
    connection::LibTmux.ControlConnection,
    target::LibTmux.PaneRef;
    direction,
    command,
    shell_command,
    start_directory,
    size,
    environment,
    kwargs...
)
```

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

Split an exact pane through its existing connection; return a strict `PaneRef`. Direction, size, command, directory and environment options match the subprocess method. Reply framing, cancellation and uncertain creation outcomes follow the control `new_window` method. No implicit pane selection or fallback is allowed.

```julia
split_window(connection::ControlConnection, pane::PaneRef; kwargs...)
```

### `split_window` (overload 2)

```julia
split_window(
    server::LibTmux.Server,
    target::LibTmux.PaneRef;
    direction,
    command,
    shell_command,
    start_directory,
    size,
    environment,
    kwargs...
)
```

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

Split the target pane in `:right`, `:left`, `:below` or `:above`; return a `PaneRef`. `size` is a positive cell count. Command, directory, deadline and strictness options follow [`new_session`](/en/julia/latest/reference/libtmux-new_session/). Identity checks are best effort. A changed identity in the reply raises `CreationResponseError` without retry or cleanup.

```julia
split_window(server, target::PaneRef; direction=:below, size=nothing, kwargs...)
```

## Parameters

- `connection` (`LibTmux.ControlConnection`) (for `split_window(connection, target, direction, command, shell_command, start_directory, size, environment, kwargs)`)
- `target` (`LibTmux.PaneRef`)
- `direction` (`Symbol`)
  Default: `:below`.
- `command`
  Default: `nothing`.
- `shell_command`
  Default: `nothing`.
- `start_directory`
  Default: `nothing`.
- `size` (`Union{Nothing, Integer}`)
  Default: `nothing`.
- `environment`
  Default: `()`.
- `kwargs`
- `server` (`LibTmux.Server`) (for `split_window(server, target, direction, command, shell_command, start_directory, size, environment, kwargs)`)
