iTerm2 not respecting my key bindings...sometimes

0

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 1.0.0.20130319) with my ghci (7.4.2) but its very annoying. Any ideas on what to do?

Drew

Posted 2013-06-01T09:04:39.953

Reputation: 273

Answers

1

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.

Lri

Posted 2013-06-01T09:04:39.953

Reputation: 34 501