Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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'm trying to get ghci (Haskell's interactive command line) to handle Ctrl+Left and Ctrl+Right arrows properly rather than showing garbage like this:

Prelude> 1;5D1;5C

At the bottom of this bug report, it says:

For the standard ghci with editline, you should add the following to your .editrc file:

bind "\e[1;5D" vi-prev-word
bind "\e[1;5C" vi-next-word

I tried adding that to ~/.editrc, but nothing changed. A MySQL bug report tells us that libedit ignores the editrc file on Linux because it doesn't have the issetugid() system call, and it looks like MySQL has its own workaround for the issue.

Does anyone know how to either:

  1. Get libedit to acknowledge ~/.editrc
  2. Get GHCi to handle Ctrl+Arrow correctly
share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.