djacobs7
djacobs7

Reputation: 11827

How to use option-delete in my .inputrc for readline

I'd like to configure my shell so that when I do 'option-backspace' then I delete the previous word.

I know I have to put something like

"\eDEL": backward-kill-word

in my .inputrc, but I can't figure out the exact thing that goes on the left. I also cannot figure out where to look this up.

What should I put in my .inputrc?

Upvotes: 0

Views: 212

Answers (1)

Benjamin W.
Benjamin W.

Reputation: 52162

It should be

"\e\b": backward-kill-word

The syntax is explained in the Bash manual, under Readline Init File.

\b is the escape for backspace.

Instead of escapes, you should also be able to use key names:

Meta-Rubout: backward-kill-word

Upvotes: 1

Related Questions