bash and $LANG and meta-key bindings

Michael Grant mg-fbsd3 at
Sun Dec 30 15:46:42 PST 2007

I upgraded from 6.2 to 6.3-prerelease and I noticed something very
strange with bash (or perhaps readline).

I have had for many hears this in my .bash_login:

    export LANG=en_US.ISO8859-15

This makes 8-bit characters come out as accented characters instead of
character codes like <C6>.  However, with the upgrade to 6.3pre,
something has changed.  Same bash binary.

If I set $LANG like this, certain meta-bindings like this do not work:

    bind '"\M-p": history-search-backward'
    bind '"\M-n": history-search-forward'

Before the upgrade, m-p would go to the previous command or the
previous command like the one that was partially typed in.  Now, it
produces a : prompt.  If I remove the LANG setting from my
.bash_login, it works fine.

So either I can have proper accented characters or I can have working
meta key bindings with bash (and readline), but not both.  Anyone know
of a fix for this?  Am I setting LANG in the wrong place?  I have
tried putting these bindings into my .inputrc but that didn't help.

Michael Grant

More information about the freebsd-questions mailing list