Reputation: 264
My .zshrc file contains the line
bindkey -v
I'm attempting to bind ^q or \M-q to push-line, e.g.
bindkey "^q" push-line
but for some reason it isn't working.
Running `bind key -v' confirms
"^Q" push-line
But it doesn't actually do anything. Other control- mappings, such as ^r, work fine.
I can successfully map "push-line" to "\eq", but I don't like this behavior. First of all, I never use esc- type bindings, and secondly doing so binds it to control, meta, and escape, which is overkill. (Incidentally, shouldn't it only bind all of them like that with `bindkey -m'? I never set that in my .zshrc?)
So, anybody have any idea what's going on here?
Upvotes: 1
Views: 467
Reputation: 12010
These shortcuts are used by Software flow control (wikipedia)
Ctrl+S
and Ctrl+Q
are used to stop and resume the output of a program.
To try it:
Run while (true) ; do echo $RANDOM ; sleep 1 ; done
Press Ctrl+S
, the output stop.
Press Ctrl+Q
, the output resume.
(I'm not sure the program is stopped like with Ctrl+Z
, i think it is stuck by lack of outputting. Ctrl+C
to kill the program.)
These shortcuts take over your shortcuts, but if you disable this flow control feature, it could work.
You can learn how to disable it in How to unfreeze after accidentally pressing Ctrl-S in a terminal? - Unix and Linux.
Try it and tell us.
Upvotes: 3