This happens a lot for me… out of habit to save a doc. But when a terminal freezes, Esc won’t work and I often just close the terminal… not a good idea especially when there are open file handlers…

To unfreeze it, simply do Ctrl-Q.

Yea, seriously, you won’t quit your terminal. Try it! =)

ref: http://unix.stackexchange.com/questions/12107/how-to-unfreeze-after-accidentally-pressing-ctrl-s-in-a-terminal