I am writing a *nix shell, I want support the key-combination of Ctrl-Enter. And the library I use is GNU readline.
I have spent several hours on it, but can't find the way.
I can bind Enter successfully, like:
========= ~/.inputrc ===============
"\C-M": "sdf"
====================================
When I press Enter, I got "sdf" echoed, just as expected.
I can also bind Esc,Enter successfully(note, here is key serial, not combination), like:
========= ~/.inputrc ===============
"\e\C-M": "sdf"
====================================
When I pressed Esc and then pressed Enter, "sdf" was echoed as expected.
However, the following line can not produce a valid Ctrl-Enter combination:
========= ~/.inputrc ===============
"\C\C-M": "sdf"
====================================
And, "\C-\C-M" doesn't work too.
Here are two related questions:
How to bind Ctrl-Enter in fish?
Can any one help me ?