Tilde when clicking key

keyboardxfce4-terminal

I am using XFCE Terminal emulator 0.4.8.

My ~/.inputrc file:

# Insert Key
"\e[2~": paste-from-clipboard
"\C-v": paste-from-clipboard
"\e[A":history-search-backward
"\e[B":history-search-forward
"\M-[3~": delete-char

When I click <Del> a tilde is printed instead of deleting the next character. When I remove .inputrc file, it starts working correctly. Googling showed, that this line:

"\M-[3~": delete-char

has helped people to cure this. But not me. I inserted this line into .inputrc, even deleted all the other lines. Doesn't work.

How to fix?

Best Answer

The line

"\M-[3~": delete-char

is incorrect because it tells bash to look for the meta character for [, which (according to bash) could be the escape character followed by [, or it could be the character formed by OR'ing [ with 0x80, i.e., 0xdb which is Û

The actual key would use just the escape character, so you should use this setting:

"\e[3~": delete-char
Related Question