no backspace, delete or arrow keys in ghci

Gabriel Schwanen g.schwanen at gmail.com
Mon Sep 7 14:50:37 EDT 2009


Yes, it is when getLine is waiting for input. Everything is fine in the 
prompt.

I didn't know that getLine behaves like that. I surely missed something. 
Trully sorry for, at the end, a so dumb question !

I'll follow your advices and try haskeline or readline :-)

Anyway, many thanks for your so quick reply.

Best regards,
Gabriel

Judah Jacobson a écrit :
> 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.
>
> Best,
> -Judah
>   



More information about the Glasgow-haskell-users mailing list