haskell / haskeline

A Haskell library for line input in command-line programs.
https://hackage.haskell.org/package/haskeline
BSD 3-Clause "New" or "Revised" License
221 stars 75 forks source link

Numpad keys being ignored at ghci prompt #76

Closed randalloveson closed 5 years ago

randalloveson commented 6 years ago

My numpad "+" and "*" keys are being ignored at the ghci prompt, but not in any readline program or even in getLine within ghci. Keycodes are 78 (KEY_KPPLUS) and 55 (KEY_KPASTERISK), respectively.

$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 8.2.2
judah commented 5 years ago

Thank you for the report. In this case, the difference between Haskeline's prompt and ghci is that Haskeline invokes the keypadOn terminal command, which may change the key sequences sent by those keys: http://hackage.haskell.org/package/terminfo-0.4.1.4/docs/System-Console-Terminfo-Keys.html#v:keypadOn

I've created #109 which should give better debugging than getLine and let you see exactly what key sequences Haskeline is receiving for those keys. Then, you may use the following instructions to add them to your ~/.haskeline` file: https://github.com/judah/haskeline/wiki/CustomKeyBindings

I'm closing this ticket because I believe that PR gives you enough tools to resolve the issue, but please feel free to re-open if you still run into problems.