# session.WindowPlacement

- **Module:** session
- **Package:** libtmux
- **Language:** Rust
- **Kind:** enum
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/session.rs#L1042
- **Page:** https://libtmux.org/en/rs/latest/reference/session-windowplacement/

Where a new window goes, relative to the index it is given.

Without one, tmux takes the first free index.

## Example

```rust
use libtmux::{NewWindowOptions, WindowPlacement};

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

// Inserting before an index shifts the windows already at or after it, so
// the index a caller holds is only good until the next insert.
let inserted = session
    .new_window(
        NewWindowOptions::new("inserted")
            .index(first.index())
            .placement(WindowPlacement::Before),
    )
    .await?;
assert!(inserted.index() <= first.index());

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

## Members

- `Before` (constant): Insert before the target index, shifting later windows along.
- `After` (constant): Insert after it.
