"hSetBuffering stdin NoBuffering" messes up terminal

David Roundy droundy at abridgegame.org
Fri Oct 17 09:02:32 EDT 2003

On Tue, Oct 14, 2003 at 09:11:47AM -0400, I wrote:
> On my terminal (aterm), calling
> hSetBuffering stdin NoBuffering
> within my program messes up the terminal settings somehow, so that
> backspace no longer works when I run my program (without the NoBuffering) a
> second time.  
> [...]
>  A simple call to hSetBuffering stdin LineBuffering doesn't seem to fix
> the problem.

That is actually not true.  My call of hSetBuffering stdin LineBuffering
wasn't actually happening (I put it after a call to exitWith).  Just for
the archives (and anyone interested) I figured I should clarify that bit of
misinformation.  It seems that as long as you set stdin's buffering back to
LineBuffering before you exit, you are safe from messing up the terminal
David Roundy

More information about the Haskell-Cafe mailing list