# tmux.Window.KillOthers

- **Module:** tmux.Window
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/lifecycle_kill.go#L220
- **Page:** https://libtmux.org/reference/go/tmux-window-killothers/

```
tmux.Window.KillOthers(ctx: context.Context) -> error
```

KillOthers destroys every other stable window selected through the receiver's exact session and leaves the receiver as that session's current and only window. Links in other sessions are not selected merely because they share the receiver's [WindowID], but every selected stable window is removed from all sessions. Other affected sessions preserve their current selection unless a 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.
