[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-bugs
Subject:    [Mono-bugs] [Bug 661922] New: Console.ReadKey and ReadLine not
From:       bugzilla_noreply () novell ! com
Date:       2010-12-30 22:14:40
Message-ID: bug-661922-28286 () http ! bugzilla ! novell ! com/
[Download RAW message or body]


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@lists.ximian.com
        ReportedBy: crokusek@pacbell.net
         QAContact: mono-bugs@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.
_______________________________________________
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic