
On Tuesday 14 October 2003 2:11 pm, David Roundy wrote:
On my terminal (aterm), calling
hSetBuffering stdin NoBuffering
within my program messes up the terminal settings somehow, [...]
If I understand recent changes correctly, this is a deliberate decision. The idea is that if you wanted to write a program like 'stty' in Haskell, you'd be very disappointed if the terminal settings got switched back the moment your Haskell program terminated. Given this (reasonable) change, it might be worth providing an additional function: hWithBuffering :: Handle -> BufferMode -> IO a -> IO a which sets the buffering mode back when it finishes. (There's a bunch of alternative designs possible here - this has the virtue of being simple.) -- Alastair Reid www.haskell-consulting.com