Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

3 Answers 3

DEL: delete-char

Should work for you.

share|improve this answer
add comment

\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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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