# session.NewWindowOptions.replace_existing

- **Module:** session.NewWindowOptions
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/session.rs#L1101
- **Page:** https://libtmux.org/reference/rs/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.
