Interrpreting modifier codes in /etc/inputrc ??

William Case billlinux at rogers.com
Thu Aug 6 22:08:54 UTC 2009


Thanks Rick;

On Thu, 2009-08-06 at 14:46 -0700, Rick Stevens wrote:
> William Case wrote:
> > On Thu, 2009-08-06 at 15:29 -0500, Mikkel L. Ellertson wrote:
> >> William Case wrote:

> > Mikkel, I would prefer to be lazy too. However, Control+right-arrow
> > simply produces ";5C" at the cursor on my command line and Control
> > +left-arrow prints ";5D".
> 
> Mikkel is correct. CTRL-left-arrow generates <ESC>[1;5C (<ESC> meaning 
> "escape" or the "\e" from the previous posts), CTRL-right-arrow produces
> <ESC>[1;5D.  

Yes that is what the keys are supposed to be designated as, but
CTRL-right-arrow and CTRL-left-arrow. should produce movement one word
at a time -- not just print out the code at the cursor location.

> If you're curios, run "showkey -a" from a command prompt
> and press those sequences:
> 
> [root at prophead ~]# showkey -a

Thanks for introducing me to the showkey command.

> As to bash just displaying the ";5C" or whatever, you have to have data
> on the command line for it to the sequences to operate on.  If you're
> just at a prompt and you hit one of those sequences, there's nothing to
> act on and you'll probably rewarded with a beep and a display of the
> remainder of the key sequence.

I did have data in the command line when I tried CTRL-right-arrow and
CTRL-left-arrow.

Since I had used a command from 'history', I tried your suggestion to
see if a new command/sentence/data made any difference. It shouldn't
have.
> 
> Try putting "the quick brown fox" after a command prompt, then use 
> CTRL-left-arrow and watch the cursor move back by words.

I did not get movement.  I only got the same ";5C" and ";5D" code
printed to stdout no matter where the cursor was placed in "the quick
brown fox". The printed code appears exactly where the cursor is placed
at the time of invoking CTRL-right-arrow or CTRL-left-arrow.

-- 
Regards Bill
Fedora 11, Gnome 2.26.3
Evo.2.26.3, Emacs 22.3.1




More information about the fedora-list mailing list