#2228: runghc screws up terminal buffering mode and doesn't reset it
--------------------+-------------------------------------------------------
 Reporter:  guest   |          Owner:  igloo   
     Type:  bug     |         Status:  new     
 Priority:  normal  |      Milestone:  6.8.3   
Component:  GHCi    |        Version:  6.8.2   
 Severity:  major   |     Resolution:          
 Keywords:          |     Difficulty:  Unknown 
 Testcase:          |   Architecture:  Multiple
       Os:  Linux   |  
--------------------+-------------------------------------------------------
Comment (by simonmar):

 Yes, zsh saves the terminal settings and restores them after every
 program; use `ttyctl -u` to stop it doing that.

 There are a couple of problems here.

  * GHCi is setting stdin/stdout to `NoBuffering` in runghc, and it
 shouldn't be.
    I think this is because runghc is executing multiple commands, and GHCi
 is
    resetting the buffering between the commands.

  * GHCi is exiting via `topHandlerFastExit` which omits all of the
 shutdown cleanup
    that the RTS normally does, in particular the restoring of the terminal
 state
    (`RtsStartup.c:hs_exit_()`).

 igloo: I can probably fix this, but I'm not completely sure about the
 second issue - I think it was you that introduced the `topHandlerFastExit`
 thing.  It doesn't look quite right to me.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2228#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to