Author: gonzalo
Date: 2007-01-04 22:48:28 -0500 (Thu, 04 Jan 2007)
New Revision: 70520

Modified:
   trunk/mcs/class/corlib/System/ChangeLog
   trunk/mcs/class/corlib/System/TermInfoDriver.cs
Log:
2007-01-04 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * TermInfoDriver.cs: honor the backspace in ReadLine.



Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog     2007-01-05 03:14:05 UTC (rev 
70519)
+++ trunk/mcs/class/corlib/System/ChangeLog     2007-01-05 03:48:28 UTC (rev 
70520)
@@ -1,3 +1,7 @@
+2007-01-04 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * TermInfoDriver.cs: honor the backspace in ReadLine.
+
 2006-12-30  Marek Safar  <[EMAIL PROTECTED]>
 
        * String.cs: Character based method only.

Modified: trunk/mcs/class/corlib/System/TermInfoDriver.cs
===================================================================
--- trunk/mcs/class/corlib/System/TermInfoDriver.cs     2007-01-05 03:14:05 UTC 
(rev 70519)
+++ trunk/mcs/class/corlib/System/TermInfoDriver.cs     2007-01-05 03:48:28 UTC 
(rev 70520)
@@ -876,6 +876,7 @@
                        bool prevEcho = Echo;
                        if (prevEcho == false)
                                Echo  = true;
+
                        StringBuilder builder = new StringBuilder ();
                        bool exit = false;
                        CStreamWriter writer = Console.stdout as CStreamWriter;
@@ -885,8 +886,12 @@
                                ConsoleKeyInfo key = ReadKeyInternal ();
                                char c = key.KeyChar;
                                exit = (c == '\n');
-                               if (!exit)
-                                       builder.Append (c);
+                               if (!exit) {
+                                       if (key.Key != ConsoleKey.Backspace)
+                                               builder.Append (c);
+                                       else if (builder.Length > 0)
+                                               builder.Length--;
+                               }
                                if (writer != null)
                                        writer.WriteKey (key);
                                else

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to