Re: Re: hat-trail fails to restore tty state

Malcolm Wallace <[email protected]> Thu, 1 Jul 2004 21:30:37 +0100
Newsgroups gmane.comp.lang.haskell.hat
Organization Dept of Computer Science, University of York
Message-ID <[email protected]>
> > > > Also, hat-trail failed to properly restore the tty state after ":q".

OK, now I understand what ghc-6 is doing, an easy fix is apparent.
It all depends on the order of calling 'stty' and hSetBuffering.
This is the wrong order (as in HatTrail.hs):

>            do system ("stty -icanon -echo")
>               hSetBuffering stdin NoBuffering
>               hSetBuffering stdout NoBuffering

and this is a working order:

>            do hSetBuffering stdin NoBuffering
>               hSetBuffering stdout NoBuffering
>               system ("stty -icanon -echo")

Regards,
    Malcolm