# tmux.Pane.Respawn

- **Module:** tmux.Pane
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/pane_process.go#L57
- **Page:** https://libtmux.org/reference/go/tmux-pane-respawn/

```
tmux.Pane.Respawn(ctx: context.Context, request: RespawnRequest) -> (Pane, error)
```

Respawn restarts the process in the receiver's exact linked pane on tmux 3.2a or newer. Command, when present, is passed as one tmux shell-command operand; Go neither executes it locally nor adds inner-shell quoting. Final semicolon protection applies only to tmux's outer command parser. See [RespawnRequest] for zero-value, directory, environment, and Kill behavior.

Respawn refreshes by PaneID, so the returned canonical [Pane] may carry a
different linked-session or winlink context. The process may be restarted
before refresh fails; in that case Respawn returns the original receiver and
the refresh error. Earlier failures return zero. Completed stderr produces a
redacted [CommandError]; a nonzero exit without stderr is followed by refresh.
