Bash – How to change readline’s/bash’s meta key

bashreadlineterminal

Readline/bash use the meta key quite often but it only works when I use the Esc-key for it.
How can I configure bash/readline to accept a different key as meta?

Best Answer

This is the same question I asked I while back, so I'm not taking credit for this, but I had to put

xterm*metaSendsEscape: true
URxvt*altSendsEscape: true

in .Xresources to make Alt work as Meta in both xterm and urxvt. It is a bit contradictory, but it works. So experiment with those options. Also, I had to put

xrdb ~/.Xresources

in .xinitrc for it to work.

Edit: My question: Emacs commands in xterm