I’m using split panes in tmux – one being vim, the other being a shell. Sometimes, around once a day, vim freezes. I can move between panes, perform any tmux commands, just vim doesn’t react to anything. This happens only with tmux. My only solution for now is to kill that pane and create a new one.
3 Answers
You might have hit Ctrl+S, which turns off flow control in terminals and stops the terminal from accepting input. It is reenabled by pressing Ctrl+Q.
-
7When you're just starting to use vim/terminal editors as your main editor, this is a very common problem. Later on, you'll end up having :wq spread throughout all your documents (or ZZ, I don't judge) and feel silly.– RobJul 29, 2013 at 15:14
-
20Amazing how you correctly guessed the problem from such such a vague description. Thanks! May 30, 2014 at 8:00
-
8Holy ...! I've been having this issue for years, and never actually searched for a solution. This answer was the first solution I found, and it literally took me 3 seconds... All those hours wasted, and you had the solution just a couple of seconds away. I wish I could upvote you more (and downvote myself). Thanks! Oct 10, 2014 at 21:29
-
7and if it happens to be twice unlucky (a remote tmux session with C-q as prefix): Type
Cltr-q
, then:
, and enter in tmux:send-keys C-q
! Apr 14, 2016 at 20:24 -
1Wow!!!. You have opened my eyes. I had this issue for years and thought that the terminal hangs due to CPU/Memory resource issue. If I remote login, then I think it is a network issue. In all such occurrences, I just kill the terminal forcefully and start a new one.– RoboAlexFeb 4, 2019 at 8:19
For me, this turned out to be a gpm problem. Run:
sudo service gym restart
See here for the related bug.
My story involved following
alias doodle='(f=$(mktemp); vim $f; echo $f)' # alias to quick edit a new file with whatever name
Now that I use this alias diff -u $(doodle) $(doodle)
vim said Vim: Warning: Output is not to a terminal
.
After that the terminal froze. Usual keys wouldn't help, e.g. Ctrl+Q, Ctrl-C, etc.
Pressing ZQ helped. It would exit the vim that you stuck in, but whos UI you can't see.
I guess vim
needs some flag (not figured out yet which) to show itself on screen when being executed from bach mode.
I hope it helps someone.
^
z
to put vim into the background too quickly afterwards.