[Mono-bugs] [Bug 81159][Wis] New - Console.In.Read doesn't allow line-oriented input with mscorlib 2.0

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Mar 16 12:15:27 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by anto.cuni at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=81159

--- shadow/81159	2007-03-16 11:15:27.000000000 -0500
+++ shadow/81159.tmp.30367	2007-03-16 11:15:27.000000000 -0500
@@ -0,0 +1,38 @@
+Bug#: 81159
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: same behaviour on linux-x86 and darwin-ppc
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: anto.cuni at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Console.In.Read doesn't allow line-oriented input with mscorlib 2.0
+
+Consider this code snippet:
+
+    public static void Main()
+    { 
+        char[] buf = new char[16];
+        int n = Console.In.Read(buf, 0, 16);
+        Console.WriteLine("Hello {0}", new string(buf, 0, n));
+    }
+
+If you compile it with mcs all works fine, but if you compile with gmcs and
+you start typing the keys are not echoed back to the screen, and the
+program is blocked until you press 16 keystrokes. Then, only the last char
+typed is printed out to the screen.
+
+Mono 1.2.3.1 has this behaviour; mono 1.1.17 and Microsoft CLR it works as
+expected. 
+
+I noticed that on the older version Console.In is of type
+System.IO.SynchronizedReader, while in the new one is of type
+System.CStreamReader.


More information about the mono-bugs mailing list