emacsgnu-screen

How can I re-enable ctrl-s inside Emacs inside GNU screen?


When editing code inside a GNU screen session (which I do a lot) using Emacs, I sometimes get into a state where everything still works (e.g. editing and scrolling works normally), except for ctrl-s which is absolutely catastrophic in emacs. ctrl-s seems to be silently ignored. As if I never pressed it. Other Ctrl combinations seem to work fine (e.g. ctrl-x).

I tried this to recover:

None of this helped.

What happened?

How can I bring ctrl-s back to life?


Solution

  • What happened?

    You most likely pressed Ctrl-a and then f by accident. This toggles flow control handling in GNU screen. When flow control handling is enabled in GNU screen Ctrl-s and Ctrl-q (Xon and Xoff) are no longer passed to the inner application.

    How can I bring Ctrl-s back to life?

    To disable flow control handling in GNU screen (the default) press Ctrl-a and then f again. It should then show -flow in the status line. Ctrl-s and Ctrl-q are now working again in emacs as expected.