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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 11221 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

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.