.inputrc settings: delete-char and [] keybindings not working

0

I am using mingw under windows. When I am using ruby (irb) my 'special' characters like []{} and \ are not working. This is because of my german keyboard, where these keys are used together with AltGr (Alt + Ctrl). I found a solution for this here or here.

Now, when I add the line

"\M-[": "["

to my .inputrc file the delete-key no longer works. It is defined as usual:

"\e[3~": delete-char

Pressing delete just returns [3, while Ctrl + v, delete returns ^[[3~ as expected.

Somehow these two definitions in .inputrc do not work together. Any ideas?

EDIT:
It is only the delete key that is not working, my other bindings all work, like:

"\e[1~": beginning-of-line              # home (ok)
"\e[2~": paste-from-clipboard           # insert (ok)
"\e[3~": delete-char                    # delete (PROBLEM)
"\e[4~": end-of-line                    # end (ok)
"\e[5~": history-search-backward        # pageup (ok)
"\e[6~": history-search-forward         # pagedown (ok)

tanascius

Posted 2010-01-08T15:14:52.607

Reputation: 219

Answers

1

DEL: delete-char

Should work for you.

gordy

Posted 2010-01-08T15:14:52.607

Reputation: 123

0

\M-[ means META-[ which can be done with ALT-[ or ESC,[ \e[ means ESC,[ but that was just redefined previously

Mircea Vutcovici

Posted 2010-01-08T15:14:52.607

Reputation: 431

But everything beside the delete key still works - so does the insert key, which is "\e[2~": ... – tanascius – 2010-01-08T15:31:22.200

0

The solution was to introduce a conditional init construct:

$if ruby
  "\M-[": "["
  "\M-]": "]"
  "\M-{": "{"
  "\M-}": "}"
  "\M-\\": "\\"
  "\M-|": "|"
  "\M-@": "@"
  "\M-~": "~"
$else
  "\e[1~": beginning-of-line              # home
  "\e[2~": paste-from-clipboard           # insert
  "\e[3~": delete-char                    # delete
  "\e[4~": end-of-line                    # end
  "\e[5~": history-search-backward        # pageup
  "\e[6~": history-search-forward         # pagedown
$endif

But the original question: what is happening here still exists :)

tanascius

Posted 2010-01-08T15:14:52.607

Reputation: 219