# window.Window.respawn

- **Module:** window.Window
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/window.rs#L498
- **Page:** https://libtmux.org/reference/rs/window-window-respawn/

```
window.Window.respawn(mut, command: Option<impl Into<OsString>>, kill: bool) -> Result<&mut Self, Error>
```

Restart the window's command in place.

Passing `None` reruns whatever the window started with. Every pane in
the window is replaced by the one the command runs in, which is what
makes this different from respawning a pane: [`crate::Pane::respawn`]
restarts one pane and leaves its neighbours alone.

# Errors

Returns an error when a pane is still running and `kill` is not set.
