-1

In Ben Orenstein's .vimrc, I see:

" Note that remapping C-s requires flow control to be disabled
" (e.g. in .bashrc or .zshrc)
map <C-s> <esc>:w<CR>
imap <C-s> <esc>:w<CR>

I would really like to use these mappings, but can't figure out what to put into .bashrc in order to "disable flow control".

How can I do this (in Bash), and will it have other unwanted consequences?

Teddy Widom
  • 356
  • 1
  • 3
  • 11
  • 1
    Three seconds of googling :( https://www.google.com/search?q=bash+disable+flow+control&oq=bash+disable+flow+control&aqs=chrome..69i57j69i60.2162j0j4&sourceid=chrome&es_sm=119&ie=UTF-8 second result in google is good too. please do research before asking for other's time. – Andy Ray Apr 21 '14 at 15:57
  • 1
    @AndyRay I hate this kind of comments: google might not give the same results to everybody; moreover in ten years, _this_ post might be the most ranked one in google. Do you want the future generations to have, for only answer: "google this first" when they actually googled to obtain the answer? btw, for me, the second google result is just stackoverflow.com. – gniourf_gniourf Apr 21 '14 at 16:35
  • @gniourf_gniourf please report duplicate questions and move to close – Peter Rincker Apr 21 '14 at 16:56
  • @PeterRincker Why would I do that? is this actually a duplicate question? if yes, please provide the link of the question. – gniourf_gniourf Apr 21 '14 at 17:01

1 Answers1

6

I use

stty -ixon

to turn off flow control and free up C-s for other uses. If you still want flow control, you can instead change the keystrokes used to stop a program with

stty stop ^e   # instead of ^s
stty start ^b  # instead of ^q

Of course, make sure the keys aren't already bound to a behavior you want to keep. Keystrokes set by stty are interpreted directly by your terminal, before they are seen by the shell.

chepner
  • 497,756
  • 71
  • 530
  • 681