Re: [GHC] #3256: Extra EOT from NoBuffering mode in emacs

2009-06-01 Thread GHC
#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


Re: [GHC] #3256: Extra EOT from NoBuffering mode in emacs

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

 * cc: nad (added)

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


[GHC] #3256: Extra EOT from NoBuffering mode in emacs

2009-05-22 Thread GHC
#3256: Extra EOT from NoBuffering mode in emacs
---+
Reporter:  judah   |  Owner:  
Type:  bug | Status:  new 
Priority:  normal  |  Component:  Compiler
 Version:  6.10.3  |   Severity:  normal  
Keywords:  |   Testcase:  
  Os:  Linux   |   Architecture:  Unknown/Multiple
---+
 Compile the following program:
 {{{
 import System.IO

 main = hSetBuffering stdin NoBuffering  getLine = print
 }}}

 Then start emacs, run M-x shell, and start the above program.  Paste the
 output of {{{replicate 252 'x'}}} as input and press return.  An extra EOT
 character is added to the end of the input:

 {{{
 $ ./foo
 
a\
 
aa\
 
a

 
\aaa\
 
aa\
 
aaa\\\
 EOT
 }}}

 I can make this happen consistently using Ubuntu 8.04.2 and emacs-22.1.1.
 I can't reproduce it on OS X or outside of emacs's shell.

 This was originally reported on the Haskeline bug tracker, as it affects
 ghci/haskeline: http://trac.haskell.org/haskeline/ticket/79 . From that
 ticket:

  The problem seems to be that Emacs does not send all of the input at
  once:
If STRING is more than 500 characters long, it is sent in several
bunches. This may happen even for shorter strings.
  (From the documentation of process-send-string in GNU Emacs 23.0.93.1.)
 See also the following message:
 http://thread.gmane.org/gmane.comp.lang.haskell.glasgow.user/15591/focus=15632.

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