# tmux.Pane.Kill

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

```
tmux.Pane.Kill(ctx: context.Context) -> error
```

Kill destroys the receiver pane through its exact linked-pane target. If panes remain and the receiver was active, tmux selects another active pane. If this was the last pane, tmux also destroys the window and removes all of its winlinks. Affected sessions preserve their current selection unless the destroyed window was current, in which case they select another. A session left without windows is destroyed; [Session.Kill] describes how tmux handles its clients. The receiver is not refreshed. Only stderr makes a completed command a [CommandError]; nonzero exits without stderr are ignored.
