# session.NewWindowOptions.replace_existing

- **Module:** session.NewWindowOptions
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/session.rs#L1117
- **Page:** https://libtmux.org/en/rs/latest/reference/session-newwindowoptions-replace_existing/

```
session.NewWindowOptions.replace_existing(mut) -> Self
```

Replace whatever already occupies the target index.

Without this, an index that is taken is an error rather than a silent
overwrite.
