[Mono-bugs] [Bug 661922] New: Console.ReadKey and ReadLine not working on linux Mono.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Dec 30 17:14:40 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=661922

https://bugzilla.novell.com/show_bug.cgi?id=661922#c0


           Summary: Console.ReadKey and ReadLine not working on linux
                    Mono.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: i686
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: crokusek at pacbell.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Description of Problem:

Console.ReadKey() is not blocking and returning 0 even if key is pressed. 

Steps to reproduce the problem:
1. 

Console.WriteLine("Press ESCAPE to exit the main server thread...");            
ConsoleKeyInfo ki;                
while ((ki = Console.ReadKey(true)).Key != ConsoleKey.Escape) 
{                    
    if (ki.KeyChar == 0)
    {
        Thread.Sleep(500);
        Console.WriteLine("Ignoring " + (int)ki.KeyChar + ", " +
ki.Key.ToString());
        continue;
    }
    Console.WriteLine("Got a " + (int)ki.KeyChar); 
}
Console.WriteLine("Main thread exiting...");



Actual Results:

Console only shows "Ignoring 0 0" every over and over (ReadKey doesn't block).
If I press keys they are echoed to console but I do not see the "Got a"
message.  Same code works on Windows under Mono 2.8.1.  .  ReadLine() also is
not working but I assume it is related.

Expected Results:

   ReadKey blocks until a key is pressed and then return keys value.

How often does this happen? 

   Everytime.


Additional Information:

   Found on Mono 2.8.1 on linux CentOs 5.4 (close to Red Hat).

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list