# pane.Pane.respawn

- **Module:** pane.Pane
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/pane.rs#L983
- **Page:** https://libtmux.org/en/rs/latest/reference/pane-pane-respawn/

```
pane.Pane.respawn(mut, command: Option<impl Into<OsString>>, respawn_mode: Respawn) -> Result<&mut Self, Error>
```

Restart the pane's command in place.

Passing `None` reruns whatever the pane started with.

# Errors

Returns an error under [`Respawn::OnlyIfDead`] when the command is
still running.
