bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] add control-arrow bindings


From: Per Bothner
Subject: Re: [Bug-readline] add control-arrow bindings
Date: Wed, 8 Mar 2017 15:52:35 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

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
address@hidden   http://per.bothner.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]