I use bash and alt+backspace key to delete a word at a time. This works nicely, but for some reason, it stops working after a while. It seems as though it does not recognize the alt key, and simply removes a character at a time.

Btw, I use screen to fork multiple bash instances.

I'd appreciate any solutions or diagnostic suggestions.

Thanks,

link|improve this question
Does it stop working after you use a specific command? Start a new window? – qor72 Mar 23 '11 at 13:44
feedback

migrated from stackoverflow.com Mar 23 '11 at 13:52

This question came from our site for professional and enthusiast programmers.

1 Answer

If you do:

bind -q backward-kill-word

it should respond with:

backward-kill-word can be invoked via "\e\C-h", "\e\C-?".

If not, you can do one or both of:

bind '"\e\C-h": backward-kill-word'
bind '"\e\C-?": backward-kill-word'

You only need one. You can tell which by pressing Ctrl-v Backspace which will output either ^H or ^?.

You should't need to, but you can add the following to your ~/.inputrc:

"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word
link|improve this answer
feedback

Your Answer

 
or
required, but never shown