#3256: Extra EOT from NoBuffering mode in emacs
---------------------------------+------------------------------------------
    Reporter:  judah             |        Owner:         
        Type:  bug               |       Status:  closed 
    Priority:  normal            |    Milestone:  6.10.4 
   Component:  Compiler          |      Version:  6.10.3 
    Severity:  normal            |   Resolution:  invalid
    Keywords:                    |   Difficulty:  Unknown
    Testcase:                    |           Os:  Linux  
Architecture:  Unknown/Multiple  |  
---------------------------------+------------------------------------------
Changes (by simonmar):

  * status:  new => closed
  * resolution:  => invalid

Comment:

 As far as I can tell, this is not a bug in GHC.  The same behaviour can be
 replicated with a C program:

 {{{
 #include <termios.h>
 #include <unistd.h>
 #include <stdlib.h>

 main()
 {
     char buf[1024];
     struct termios termios;
     int r;

     tcgetattr(0,&termios);
     termios.c_lflag &= ~ECHO;
     termios.c_lflag &= ~ICANON;
     termios.c_cc[VMIN]  = 1;
     termios.c_cc[VTIME] = 0;
     tcsetattr(0,TCSANOW,&termios);

     do {
         r = read(0, &buf, 1024);
         write(1, buf, r);
     } while (r != 0);

     exit(0);
 }
 }}}

 If you paste a line of 255 x's to the C program in emacs, you'll see a
 `^D` character inserted in the output, in exactly the same way as with the
 Haskell program.  This appears to be something that emacs is doing when
 stdin has ICANON unset.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3256#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to