Bug 11221 - Console.Read terminates when I type any character
Summary: Console.Read terminates when I type any character
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-03-18 02:54 UTC by Stas Kalashnikov
Modified: 2016-05-25 11:18 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Stas Kalashnikov 2013-03-18 02:54:37 UTC
MSDN about System.Console.Read() (http://msdn.microsoft.com/en-us/library/system.console.read.aspx)

The Read method blocks its return while you type input characters; it terminates when you press the Enter key.

Simplest example:

class Read
{
    static void Main()
    {
        System.Console.Read();
    }
}

Actual result: it terminates when any character key pressed.

Expected result: it should print input characters and terminates only when the Enter key pressed.

Linux: 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 19:02:34 UTC 2013 i686 i686 i686 GNU/Linux

Mono JIT compiler version 3.0.7 (tarball Sun Mar 17 15:56:17 MSK 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            Included Boehm (with typed GC and Parallel Mark)
Comment 1 Stas Kalashnikov 2014-05-28 09:53:24 UTC
The bug is present in the release 3.4.0 (tarball).

Mono JIT compiler version 3.4.0 (tarball Thu Apr 24 10:23:10 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen
Comment 2 Martin Kukac 2016-05-25 11:18:50 UTC
The bug stil prevails in the release 4.2.2.

Mono JIT compiler version 4.2.2 (Stable 4.2.2.10/7b87787 Sat Jan  2 05:11:44 CST 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen


Just a side note: When I try to run binary built by MonoDevelop under Linux in Windows 7 / .NET 4.0, everything works as expected, so it seems to be bug of mono runtime.

Note You need to log in before you can comment on or make changes to this bug.