Bug#846279: ghc: Problems with Backspace, Delete and arrow keys

Richard Smith smithrm at gmx.co.uk
Thu Dec 1 15:22:22 UTC 2016


Hi Ilias,

Thanks for your further assistance. Upon further investigation, I think I've found that this happens if I use...

hSetBuffering stdout NoBuffering
hSetBuffering stdin NoBuffering

...at the very start of my main statement, so it might indeed be the correct behaviour, although I've not had this happen before. 
Curiously, I also get the same behaviour in ghci when not using hSetBuffering at all. Please see the attached screenshot.

What do you think? Have I made a mistake with this bug report?

Many thanks!

> Sent: Thursday, December 01, 2016 at 2:11 PM
> From: "Ilias Tsitsimpis" <i.tsitsimpis at gmail.com>
> To: "Richard Smith" <smithrm at gmx.co.uk>
> Cc: 846279 at bugs.debian.org
> Subject: Re: Bug#846279: ghc: Problems with Backspace, Delete and arrow keys
>
> Hi Richard,
> 
> On Wed, Nov 30, 2016 at 08:28PM, Richard Smith wrote:
> > The issue is happening before getLine receives the user's input. So, suppose I
> > have a basic function that asks for my name and then echoes it back to the
> > terminal; if I make a typo while inputting my name and then try to backspace to
> > correct, the console will display the "^?" characters. E.g.
> 
> Unfortunately, I cannot reproduce this. Backspace works as expected for
> me for the following program:
> 
>     $ echo "main = getLine >>= putStrLn" > Test.hs
>     $ ghc -o test Test.hs
> 
> using both v7.10.3 and v8.0.1.
> 
> Could you please try the following program in C:
> 
> ================== %>< ============================
> #include <stdio.h>
> 
> int main(void)
> {
> 	char s[32];
> 
> 	fgets(s, 32, stdin);
> 	printf("%s", s);
> 	return 0;
> }
> ================== ><% ============================
> 
> Does backspace work in that case?
> 
> -- 
> Ilias
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot.png
Type: image/png
Size: 118952 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-haskell-maintainers/attachments/20161201/daca0e38/attachment-0001.png>


More information about the Pkg-haskell-maintainers mailing list