no backspace, delete or arrow keys in ghci
judah.jacobson at gmail.com
Mon Sep 7 14:24:47 EDT 2009
On Mon, Sep 7, 2009 at 11:12 AM, Gabriel Schwanen<g.schwanen at gmail.com> wrote:
> Hello to everybody,
> I'm currently working with Haskell via the ghc interpreter (version 6.10.4
> on Ubuntu 9.10).
> The problem, if it is really a problem and not a normal comportement,
> happens when I try, as example, to enter some characters after having
> execute getLine. Actually, if I make a mistake when typing the string, I
> can't use neither backspace, delete or even arrow keys to correct it before
> hitting enter to finish input. In fact, as example, if I hit backspace, I
> get "^?" in place of deleting the previous character ... :^(
> As I wrote above, I don't know if it is a "bug" or not. Maybe it is normal.
> Can someone help me ?
I'm not sure I understand. Are you saying that you can't use
backspace/arrows/etc when the getLine command itself is waiting for
input? But otherwise at the "Prelude>" prompt, where you type in the
commands, everything behaves fine?
If so, that is normal behavior for the getLine function. For a better
input interface I'd recommend either the haskeline or readline
packages, both available from hackage.haskell.org.
More information about the Glasgow-haskell-users