# window.SplitOptions

- **Module:** window
- **Package:** libtmux
- **Language:** Rust
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/window.rs#L1846
- **Page:** https://libtmux.org/en/rs/latest/reference/window-splitoptions/

Options for splitting a window or pane into a new pane.

A bare [`SplitDirection`] is accepted wherever this is:
`window.split(SplitDirection::Below)`.

## Example

```rust
use libtmux::{SplitDirection, SplitOptions};

let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("split").await?;
let window = session.active_window().await?.expect("a session has a window");

// Splitting leaves focus where it was unless asked otherwise, so a caller
// that wants the new pane selected says so.
let pane = window
    .split(SplitOptions::new(SplitDirection::Right).select())
    .await?;
assert_eq!(window.active_pane().await?.map(|active| active.id().to_string()),
           Some(pane.id().to_string()));

guard.shutdown().await?;
```

## Members

- `new` (method): Describe a split placing the new pane in one direction.
- `start_directory` (method): Set the new pane's working directory.
- `command` (method): Run a command instead of the default shell.
- `size` (method): Give the new pane a size, in cells or as a share of the space.
- `environment` (method): Set an environment variable for the process the new pane starts.
- `full` (method): Span the full width or height of the window rather than of the pane.
- `zoom` (method): Zoom the new pane, filling the window until it is unzoomed.
- `select` (method): Make the new pane active.
