Bug#846279: ghc: Problems with Backspace, Delete and arrow keys
smithrm at gmx.co.uk
Thu Dec 1 15:22:22 UTC 2016
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?
> 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;
> fgets(s, 32, stdin);
> printf("%s", s);
> return 0;
> ================== ><% ============================
> Does backspace work in that case?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 118952 bytes
Desc: not available
More information about the Pkg-haskell-maintainers