#2228: runghc screws up terminal buffering mode and doesn't reset it
-------------------------------+--------------------------------------------
    Reporter:  guest           |       Owner:       
        Type:  bug             |      Status:  new  
    Priority:  normal          |   Component:  GHCi 
     Version:  6.8.2           |    Severity:  major
    Keywords:                  |    Testcase:       
Architecture:  x86_64 (amd64)  |          Os:  Linux
-------------------------------+--------------------------------------------
 If I use runghc to run a Haskell script that reads from stdin, my terminal
 gets put into a strange buffering mode.  This makes the script essentially
 unusable: characters are echoed twice, and Backspace and EOF don't work.
 The state is not even reset afterwards, so future non-Haskell programs act
 strangely as well.

 {{{
 $ cat cat.hs
 main = putStr =<< getContents
 $ stty
 speed 38400 baud; line = 0;
 eol = M-^?; eol2 = M-^?; swtch = M-^?;
 iutf8
 $ runghc cat.hs
 hheelllloo

 ^D^?^D^D^C
 cat.hs: exception :: GhcException

 $ stty
 speed 38400 baud; line = 0;
 eol = M-^?; eol2 = M-^?; swtch = M-^?; min = 1; time = 0;
 iutf8
 -icanon
 }}}

 There is no problem if the script is compiled with ghc instead of
 interpreted with runghc.

 I'm using ghc 6.8.2-2ubuntu1 on hardy amd64.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2228>
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