|
Re: ghc-6 messing with terminal settings?: msg#00002lang.haskell.glasgow.bugs
"Simon Marlow" <simonmar@xxxxxxxxxxxxx> writes: > > It would appear that ghc-6 is being careful to save the current state > > of the terminal at the point of hSetBuffering, and to restore it on > > exit, something ghc-5 did not do. But paradoxically, this "safer" > > choice caused things to mess up, instead of getting better! > > Your diagnosis is spot on. > > I suggest you just remove the 'stty' commands in that code (which don't > work on Windows, incedentally), and it will do what you want. But such a solution will not work in nhc98 or Hugs I suspect. The '98 Report does not AFAIK specify any particular terminal behaviour for programs using hSetBuffering, so ghc goes beyond the standard here. Perhaps all the compilers should follow suit, but that is a discussion we haven't had yet. > Better even: GHC will save and restore the terminal settings, > whereas your program always sets the terminal to icanon/echo on exit. Yes, calling stty was always a bit of a hack anyway. But it highlights the real lack, which is a a portable library in Haskell (System.Console.Term?) to give explicit control over these matters. Alastair Reid suggests something like data TTYState = ..... getTTYState :: IO TTYState setTTYState :: TTYState -> IO () Regards, Malcolm
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: ghc-6 messing with terminal settings?, Simon Marlow |
|---|---|
| Next by Date: | RE: ghc-6 messing with terminal settings?, Simon Marlow |
| Previous by Thread: | RE: ghc-6 messing with terminal settings?, Simon Marlow |
| Next by Thread: | RE: ghc-6 messing with terminal settings?, Simon Marlow |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |