Meta keybindings for bash readline from .inputrc not working

1

If I put

"\M-p": previous-history

into my .inputrc and fire up a terminal (urxvt or xterm), hitting Alt-p prints a ":" character. Subsequent hits produce ^[p like so:

:^[p^[p^[p^[p^[p

I would like for Alt-p to give me the previous command in history as Control-p does. I have verified that .inputrc is being read by binding previous-history to Control-t, and that worked.

"\C-t": previous-history

I have also tried

Meta-p: previous-history

with no success.

Has anyone else had this issue? Am I doing something wrong? I'm on Debian sid using xmonad.

Matt

Posted 2014-06-08T04:57:21.543

Reputation: 165

Answers

6

Adding

set convert-meta on

enabled me to set bindings like:

Meta-r: kill-line Meta-r: kill-line

user361160

Posted 2014-06-08T04:57:21.543

Reputation: 76

Added that line to the top of my .inputrc, followed by Meta-p: previous-history and Meta-n: next-history did the trick. Thanks! – Matt – 2014-08-24T20:50:02.057