On 03/08/2017 03:35 PM, Chet Ramey wrote:
On 3/8/17 12:50 PM, Per Bothner wrote:
I have the following in my ~/.inputrc, but I think they should be
bound by default, just like the arrow keys:
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[3;5~": kill-word
These bind control-left-arrow, control-right-arrow, and control-delete
to their "standard" keybindings.
How standard are these escape sequences? I use Mac OS X, so obviously
they don't work at all for me.
They're very standard:
https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts#Text_editing
They might even work on Mac OS, though the modifier key needed might be
different.
I suggest starting up 'cat' (with no editing front-end) and try typing
left-arrow, right-arrow, and delete with various modifier keys.
The Option key is most interesting, as that appears to be the standard for Mac.
(There is no standard unique escape sequence for control-backspace,
unfortunately;
that just sends ctrl-H.)
I'd also try the same thing on Emacs, both in a Gui and in terminal.
If (for example) Option-Left moves left one word in Emacs, then it would be nice
to have that also work in readline.
You might have to test multiple terminal emulators, since they might not
all generate the same byte-sequences for a given key. On Fedora Linux,
xterm, Gnome Terminal, Konsole, and my own DomTerm all work.
--
--Per Bothner
[email protected] http://per.bothner.com/
_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline