[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



           Summary: Console.ReadKey and ReadLine not working on linux
    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:

Console.WriteLine("Press ESCAPE to exit the main server thread...");            
ConsoleKeyInfo ki;                
while ((ki = Console.ReadKey(true)).Key != ConsoleKey.Escape) 
    if (ki.KeyChar == 0)
        Console.WriteLine("Ignoring " + (int)ki.KeyChar + ", " +
    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? 


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