abo-abo / lispy

Short and sweet LISP editing
http://oremacs.com/lispy/
1.2k stars 132 forks source link

Incompatible with arrow keys on xterm #534

Closed NightMachinery closed 4 years ago

NightMachinery commented 4 years ago

See here. I copy:

There other day I ran Emacs in an xterm (I usually use the GUI version) and the arrow keys didn't work, they inserted capital letters, A, B, C, D, and sometimes also did something else weird.

I thought this was a problem I'd seen before, with $TERM not properly set or something like that, but then noticed that arrow keys with a modifier, shift, control or meta, did work as expected. It seemed unlikely that those more complicated keys were configured correctly but the plain arrows were not. (Also I did have $TERM correctly set to xterm.)

The solution to the mystery was that I had a binding for M-O, but arrow keys in xterm send M-O A, M-O B, M-O C and M-O D, and xterm.el remaps those combinations to the arrow keys. For this to work you need to keep M-O free to be a prefix key. Removing the binding for M-O fixed the issue.

lispy binds M-O:

 (lispy-string-oneline)

 Documentation
 Convert current string to one line.

 Key Bindings
 lispy-mode-map M-O
 lispy-mode-map-evilcp M-O
 lispy-mode-map-lispy M-O

 References
 lispy-string-oneline is unused in lispy.el.
abo-abo commented 4 years ago

Thanks.