the corner office

a blog, by Colin Pretorius

Ctrl-S hangs an xterm

I'm sure this happens to lots of people with a Windows background (or even people who live in 'modern' editors like Kate or gedit). Editing in vim, and instead of hitting Escape and :w to save the file, I hit Ctrl-S. Instead of saving the file, the vim session 'hangs' and won't respond to the usual keypresses. This happened to me once before and I must admit that the last time I manually killed the vim process. This time around Google was at hand, and now I know I'm not the only one who's had this problem :-)

Solution: it's not vim's fault, it's actually an xterm thing. In xterm, Ctrl-S is a kind of scroll lock and locks the console. Hitting Ctrl-Q gets things back to normal.

{2005.03.12 01:53}

Comments:

1. Pradeep (2006.11.10 - 05:56) #

This is very useful information, i earlier faced this problem and lost my changes as i killed the session manually.

2. suman (2008.05.13 - 12:43) #

This is the thing I was looking for long time; great thing, of great help. Thank you.

3. Cliff (2008.10.23 - 14:00) #

Thank you so much. I already killed more than 10 sessions for this problem. I should search google earlier...

4. David (2008.11.05 - 21:58) #

This trick made my day. Thank you!!

5. bash (2008.11.20 - 19:48) #

thanks man.

6. Narmada (2009.05.13 - 01:19) #

Thank u. It is very helpful.

7. white_rotten_rabbit (2009.08.28 - 12:19) #

Thank you very much from me too, what a great help!

8. Trashead (2010.04.16 - 03:17) #

Thanks Man!!!

9. HV Gowda (2010.06.08 - 01:18) #

Thanks a lot it is very helpfull :-).

10. Pat (2010.07.09 - 23:04) #

Thanks, this helped.

11. James Strong (2010.08.19 - 14:03) #

That was SO very helpful, I just kept restart the xterm session.

12. sandy (2010.09.11 - 23:42) #

Very Helpful! THanks a lot!

13. Narendra (2010.10.05 - 05:07) #

Very Helpful!

14. Anuradha (2010.10.21 - 06:42) #

It worked for me. Thanks a lot. Was looking for it from long time

15. loonies (2010.12.28 - 04:13) #

hahhaha, I'm not the only one :)
thanks a lot!

16. Rok (2011.01.20 - 07:18) #

Thx.

17. varun (2011.03.25 - 09:12) #

THANKS A LOT!!!

18. Priya Sundararajan (2011.04.18 - 15:28) #

Thanks!

19. Ulises (2011.05.14 - 02:22) #

It also worked for me, I was going to contact IT department, but google is always faster :)

20. Allan Daemon (2011.05.15 - 23:58) #

THANKS A LOT!!!

21. daniel (2011.05.23 - 10:01) #

very very helpful. thx a lot!

22. Rob (2011.06.14 - 16:44) #

Brilliant. I cannot tell you how much frustration this has liberated from my life.

23. Keyur (2011.07.28 - 10:20) #

Thanks lot... Any idea how to disable 'Ctrl-S' from xterm?

24. Amaelitha (2011.08.10 - 17:32) #

Fantastic ! Thanks !!
It happened to me a lot of times. If only I had searched google earlier...

25. Anand (2011.11.30 - 10:51) #

Thanks a real lot. This has ended a long-standing point of frustration for me. I can't recount how many xterms/screens I have had to kill because of this stupid problem. Somehow thought of googling it very late in the day.

Brilliant.

Anand

26. Vitalii (2012.01.20 - 18:59) #

Thanks a lot.

27. tednoob (2012.02.07 - 10:15) #

I... I... I love you.

28. Vidya Teli (2012.02.16 - 05:46) #

thanks a lot, it was happening a lot as i was using cscope ctrl \s, everytime i had to kill xterm!!

29. rev (2012.04.19 - 19:51) #

thanks for posting this... i hit ctrl-s instead of ctrl-d in vim when my hands were not on the keyboard quite right. this has happened several times and i end up killing my terminal session and losing my document changes.

30. Marto (2012.08.15 - 15:31) #

¡Excellent!

31. Mehul (2012.09.23 - 22:17) #

Thanks a ton! It was kind of frustrating when it was happening in a working xterm, now I have solution with your help.

32. Chethan (2012.10.24 - 08:41) #

Thanks a lot !!!!
Great info..... i was wondering why this is happening tried even xterm help ... no use
Thanks for the very useful info!!

33. Chris (2012.11.12 - 18:08) #

Me too! Thank you so much! It was bugging me big time... now how do we unmap it?!

34. a s d f (2012.11.23 - 15:32) #

Thank you, thank you, thank you.

I almost destroyed my keyboard trying to get vim alive.

35. Sal (2012.11.29 - 16:01) #

For years this bugged me...THANKS! One keystroke I won't forget.

36. Michael Longval (2013.02.10 - 22:05) #

Thanks you very , very much.

This was driving me nuts!!!!!

37. decebal2dac (2013.02.18 - 22:38) #

waaaaaaaaaaaaaa :*:*::*

38. alvin (2013.04.28 - 07:00) #

haha æ??ä¸?å­¤ç?¬å??~
haha thanks~

39. julia (2014.01.21 - 07:53) #

Thank you SOOOOO much!!!!!

40. Peter (2014.02.02 - 22:51) #

LOL, me too man, me too. Thanks for the post. :)

41. Eric (2014.02.06 - 15:56) #

This happens occasionally and it sometimes takes me 15 minutes to find a webpage to remind me of the keys required to undo it. I'm finally bookmarking this page! Thanks!

42. Deepak (2014.06.12 - 22:19) #

This is truly helpful, Thanks !!!!

43. Shah (2015.03.03 - 13:27) #

This is really useful info. Thanks.

44. dopamine (2015.09.19 - 00:00) #

Halleluja!!!

« Installed Gentoo on an old machine

» Dept of Forgotten Bands (and web sites)