How to force stop hang tmux and terminal session

When scrolling on a tmux pane, my tmux session suddenly got stuck and it stopped responding to any command. I decided to just close the terminal. On a new terminal, I tried to create a new tmux session, but every tmux command would get stuck none of the force quit works. So, the only option is to close the terminal itself.

Since the tmux session wasn’t anything sensitive, I decided to delete the tmux session itself. Tmux session are stored in /tmp/tmux-XXXX folder where XXXX represents some number. My session was stored in /tmp/tmux-1000, which I deleted. Caution: You’ll lose your session if you delete this folder which was not an issue for me.

rm -r /tmp/tmux-1000

Running any tmux command now would give me following error

error connecting to /tmp/tmux-1000/default (No such file or directory)

which can be resolved with creating a new session.

I had old tmux zombie process still running in the background which I deleted with pkill. I had to force delete one of them which was not deleted by pkill command

pkill tmux
ps aux | grep tmux
kill -9 pid

Leave A Comment