[Mono-bugs] [Bug 81050][Nor] Changed - [PATCH] System.Console.ReadKey() do not have the same behavior as MS.NET

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Apr 16 19:07:12 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 fejj at novell.com.


--- shadow/81050	2007-04-16 18:58:57.000000000 -0400
+++ shadow/81050.tmp.9023	2007-04-16 19:07:12.000000000 -0400
@@ -56,6 +56,26 @@
 ------- Additional Comments From fejj at novell.com  2007-04-16 18:58 -------
 Created an attachment (id=19070)
+------- Additional Comments From fejj at novell.com  2007-04-16 19:07 -------
+I think this patch fixes the problem in a better way, taking advantage
+of terminal echo features.
+Notes: some of the code cleanup I did isn't really necessary - for
+example the GetCursorPosition()/ReadKey()/ReadLine() could just as
+easily be skipped.
+- GetCursorPosition(): since the Echo properties called back into
+Init() (GetCursorPosition() is an Init() helper function), it just
+seemed bad.
+- ReadKey()/ReadLine() since the Echo properties call Init(), no need
+for these 2 functions to call it explicitly. Also, by not calling
+Init() explicitly, we effectively "optimize" things by having
+Echo::set call Init() for us with the proper echo state, thus avoiding
+2 calls to ConsoleDriver.SetEcho() to achieve the same end result.
+The last reason is probably a "soptimization", but oh well :)

More information about the mono-bugs mailing list