9

If you press Ctrl + s while using vim would result with vim to look like as if it is being locked/stuck without you being able to make more changes unless you press Ctrl + q.

Could someone explain what is happening and why?

Hint - it might be something to do with the OS's terminal driver! ;-)

Due to a negative initial perception from the community despite having hinted that this was nothing to do with vim but some novice may search for a solution with regards to vim anyway, I would add:

I hope the updated question is much more useful.

13

Well, It's no a vim issue. This is called Software flow control. There is a bunch of info out there on the internet.

According to an article in here:

CTRL-S (XOFF) is part of Software flow control. XOFF notifies the process or device sending data that the input buffer is full and it shouldn't send any more data. The software (outputting process, firmware, terminal etc) can choose how to handle the notification - i.e. keep running and buffer data, drop data, pause until XON is received, etc.

More info about Software flow control here.

NOTE: if you want to get the control of your terminal after you pressed CTRL + s key combination, you can press CTRL + q.

I hope this helps.

| improve this answer | |
  • 4
    Note that if it's a annoyance you can disable Ctrl-s on Linux by adding stty stop "" to one of your start-up scripts (eg ~/.bashrc). – AFH Jan 5 '19 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.