Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)
share|improve this question

DEL: delete-char

Should work for you.

share|improve this answer

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

share|improve this answer
    
But everything beside the delete key still works - so does the insert key, which is "\e[2~": ... – tanascius Jan 8 '10 at 15:31

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 :)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .