# window.Respawn

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

What to do about a process still running where one is being respawned.

tmux refuses `respawn-pane` and `respawn-window` outright while the old
command is alive unless `-k` says otherwise, so the choice is not a detail
-- it decides whether a live process is killed.

## Example

```rust
use libtmux::Respawn;

// Rerun the pane's own command, killing it first if it is still running.
pane.respawn(None::<&str>, Respawn::Replacing).await?;
```

## Members

- `Replacing` (constant): Kill whatever is running first. tmux's `-k`.
- `OnlyIfDead` (constant): Refuse unless the pane or window is already dead.
