4

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?

  • 1
    "\e[3~": delete-char should work better – sendmoreinfo Sep 8 '15 at 22:14
  • @sendmoreinfo This is great, but when I delete a line completely with Ctrl-D, using your code, it just closes the console. – user4035 Sep 8 '15 at 22:17
  • That's C-d default action (to send EOF). You could change that with stty eof – sendmoreinfo Sep 8 '15 at 22:21
  • 1
    @sendmoreinfo I used "export IGNOREEOF=42" to make 42 consecutive Ctrl-D clicks exist the shell. – user4035 Sep 9 '15 at 7:30
5

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
| improve this answer | |
  • In my case using mintty , the "\M-[3~": delete-char was the correct bind to get rid of the TILDE :-/ – PYK Mar 6 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.