Bhaskar Bhaskar - 1 month ago 4x
Linux Question

Killing Tmux window from outside tmux

On a Linux machine, I run Tmux session with 3 windows. I connect to this Linux machine using ssh. A process running in one window is spewing lot of logs, pretty much not letting me do anything else (can't switch windows or even kill that window). Is there a way I can kill this window from the shell (by opening another ssh connection to this box)? I do not want to kill the process. Just the window.


Read man tmux there is command called kill-window

kill-window [-a] [-t target-window] (alias: killw)

Kill the current window or the window at target-window, removing it from any sessions to which it is linked. The -a option kills all but the window given with -t.

So if you know window name or index you can press Prefix+: to call command mode and than type

kill-window -t window_name

Or from outside of tmux

tmux kill-window -t session_name:window_name