readline + binding; still frustrated after 4 yrs of trying

William Case billlinux at rogers.com
Thu Mar 11 18:37:29 UTC 2010


Hi;

On and off for the last few years I have tried to get readline to bind
commands as I want them but they never have. I am sure I am doing
something stupid or mis-interpreting the manuals and all the previous
advice I have received. I posted this problem over a week ago on the
Fedora Forum but got nothing helpful.  So here -- slowly -- is my
problem.

I can find "\e-f": forward-word and "\e-b": backward-word
in /etc/inputrc and they work.

However, I find the \e- key combination a bit of a finger reach and I
use forward-word and backward-word a lot so I wanted to add a key
modifier combination that was easier. I have tried several different
versions of key binding in ~/.inputrc but nothing seems to work. Here is
the latest version of my ~/.inputrc:

    # Bill's inputrc for ReadLine

    # '$include' directs readline to the file
    # with 'universal' settings.

    $include /etc/inputrc

    $if mode=emacs

    "\M-\C-b": backward-word
    "\M-\C-f": forward-word

    $endif

As I say, I have tried several different versions e.g "\M-\C-b": and
"\M-\C-f: but nothing works. Even after using C-xC-r or rebooting.  (I
am familiar with emacs bindings.)
_______________

I have checked that the emacs mode is on:

    ]$ env
    ...
    VISUAL=emacs
    GIT_EDITOR=emacs
    ....

        ]$ set -o (which tells me )
        ...
        emacs on
        ...
        vi off.

So the mode=emacs has nothing to do with the key binding problem I am
having.
________________


For the above file:

    ]$ bind -P
    ...
    backward-word can be found on "\eOd", "\e[1;5D", "\e[5D", "\eb",
"\202", ...
    ...
    forward-word can be found on "\eOc", "\e[1;5C", "\e[5C", "\ef",
"\206".

...
__________________

Where do "\202" and "\206" come from and what are they. While we are at
it, where can I find a meaningful translation of "\eOd", "\e[1;5D",
"\e[5D", etc. I know what \e is but what do [, O, 1 mean? How could I
find them on a keyboard?

I have tried:
]$ bind "\C-\M-b": backward-word
and
]$ bind "\C-\M-f": forward-word

to no effect.
___________________

Meta (ALT) -b works (does backward-word) for some reason (as
in /etc/inputrc) but \M-\C-b doesn't.
Meta (ALT) -f gives me the window menu, as it should. I don't want to
change that. But ~/.inputrc gives me nothing with ALT(Meta)-CTRL-f. I
was kind of hoping to figure out how to substitute \M-\C- for  all or
many of the "\e" bindings on my local or users .inputrc.

Currently ]$ env doesn't show INPUTRC which should be the correct
default.

In case it is helpful, my ~/.bash_profile contains # export INPUTRC=
$HOME/.inputrc [commented out #, and in at different times].

I am currently using Fedora 12 kernel version 2.6.32.9-67.fc12.x86_64.;
but as I said I haven't been able to figure this out over several
versions. Others don't seem to be having any problem at all. I would
deeply appreciate it if someone could help me sort this out.

I am sure that the problem comes from my doing something silly or from
staring at it too long, or making it more complex than it really is; but
for now I am stumped.

-- 
Regards Bill
Fedora 12, Gnome 2.28
Evo.2.28, Emacs 23.1.1



More information about the users mailing list