[Mono-list] Cross-Platform Managed Read from Console

Miguel de Icaza miguel@ximian.com
24 Feb 2003 17:40:49 -0500


> There's another suggestion I got - to use libc/msvcrt standard c library
> functions
> like getch() or such.  However, how would you create C# code that could
> DllImport into the libc/msvcrt functions in a platform independent way?

I think you will have to code two code paths: one for Windows and one
for Unix to turn off the echo.  

In the Unix case there are a number of solutions, the easy way of doing
this is to call stty with system(), but its not the most clean way.

Two options:

	stty -echo

	That will turn off the echo.

	stty cbreak

	Will turn on the `I provide the characters, you figure out what
	to do with it' mode.