I have my iTerm2 keybindings set to have command+left arrow and command+right arrow move the cursor to the beginning and end of the line. This works most of the time. But not when I am in ghci (the Haskell interpreter)

It works in other interpreters though (I've tried python and sh)

I'm not sure if this is a problem with my shell (bash 3.2) or with iTerm2 (Build with my ghci (7.4.2) but its very annoying. Any ideas on what to do?


ghci uses haskeline instead of readline. If you remapped ⌘← and ⌘→ to \e[H and \e[F, add this to ~/.haskeline:

keyseq: "\ESC[H" ctrl-a
keyseq: "\ESC[F" ctrl-e

You could also remap ⌘← and ⌘→ to ⌃A and ⌃E.

See http://trac.haskell.org/haskeline/wiki/CustomKeyBindings.

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.