--- /dev/null
+//
+// System.CStreamReader
+//
+// Authors:
+// Dietmar Maurer (dietmar@ximian.com)
+// Miguel de Icaza (miguel@ximian.com)
+// Dick Porter (dick@ximian.com)
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// (C) Ximian, Inc. http://www.ximian.com
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace System.IO {
+ class CStreamReader : StreamReader {
+ public CStreamReader(Stream stream, Encoding encoding)
+ : base (stream, encoding)
+ {
+ }
+
+ public override int Peek ()
+ {
+ try {
+ return base.Peek ();
+ } catch (IOException) {
+ }
+
+ return -1;
+ }
+
+ public override int Read ()
+ {
+ try {
+ ConsoleKeyInfo key = Console.ReadKey ();
+ return key.KeyChar;
+ } catch (IOException) {
+ }
+
+ return(-1);
+ }
+
+ public override int Read ([In, Out] char [] dest_buffer, int index, int count)
+ {
+ if (dest_buffer == null)
+ throw new ArgumentNullException ("dest_buffer");
+ if (index < 0)
+ throw new ArgumentOutOfRangeException ("index", "< 0");
+ if (count < 0)
+ throw new ArgumentOutOfRangeException ("count", "< 0");
+ // ordered to avoid possible integer overflow
+ if (index > dest_buffer.Length - count)
+ throw new ArgumentException ("index + count > dest_buffer.Length");
+
+ int chars_read = 0;
+ while (count > 0) {
+ int c = Read ();
+ if (c < 0)
+ break;
+ chars_read++;
+ count--;
+
+ dest_buffer [index] = (char) c;
+ //if (CheckEOL (dest_buffer [index++]))
+ // return chars_read;
+ }
+ return chars_read;
+ }
+
+ public override string ReadLine ()
+ {
+ try {
+ return ConsoleDriver.driver.ReadLine ();
+ } catch (IOException) {
+ }
+
+ return null;
+ }
+
+ public override string ReadToEnd ()
+ {
+ try {
+ return (base.ReadToEnd ());
+ } catch (IOException) {
+ }
+
+ return null;
+ }
+ }
+}
+#endif
+
--- /dev/null
+//
+// System.CStreamWriter
+//
+// Authors:
+// Dietmar Maurer (dietmar@ximian.com)
+// Paolo Molaro (lupus@ximian.com)
+// Dick Porter (dick@ximian.com)
+//
+// (c) 2006 Novell, Inc. http://www.novell.com
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System;
+using System.Text;
+
+namespace System.IO {
+ class CStreamWriter : StreamWriter {
+ TermInfoDriver driver;
+
+ public CStreamWriter (Stream stream, Encoding encoding)
+ : base (stream, encoding)
+ {
+ driver = (TermInfoDriver) ConsoleDriver.driver;
+ }
+
+ public override void Write (char [] buffer, int index, int count)
+ {
+ if (count <= 0)
+ return;
+
+ for (int i = 0; i < count; i++) {
+ Write (buffer [index + i]);
+ }
+ }
+
+ public override void Write (char val)
+ {
+ lock (this) {
+ try {
+ if (driver.NotifyWrite (val))
+ InternalWriteChar (val);
+ } catch (IOException) {
+ }
+ }
+ }
+
+ public void WriteKey (ConsoleKeyInfo key)
+ {
+ lock (this) {
+ ConsoleKeyInfo copy = new ConsoleKeyInfo (key);
+ if (driver.NotifyWrite (copy))
+ InternalWriteChar (copy.KeyChar);
+ }
+ }
+
+ public void InternalWriteString (string val)
+ {
+ try {
+ base.Write (val);
+ } catch (IOException) {
+ }
+ }
+
+ public void InternalWriteChar (char val)
+ {
+ try {
+ base.Write (val);
+ } catch (IOException) {
+ }
+ }
+
+ public override void Write (char [] val)
+ {
+ Write (val, 0, val.Length);
+ }
+
+ public override void Write (string val)
+ {
+ if (val != null)
+ Write (val.ToCharArray ());
+ }
+ }
+}
+#endif
+
+2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * ConsoleDriver.cs:
+ * TermInfoDriver.cs:
+ * IConsoleDriver.cs:
+ * CStreamWriter.cs:
+ * ConsoleKeyInfo.cs:
+ * NullConsoleDriver.cs:
+ * Console.cs:
+ * CStreamReader.cs:
+ * WindowsConsoleDriver.cs: initial changes to handle cursor position
+ and screen buffers.
+
2006-09-21 Gert Driesen <drieseng@users.sourceforge.net>
* ArithmeticException.cs: Modified default message to match MS, to
}
}
- private static TextWriter stdout;
+ internal static TextWriter stdout;
private static TextWriter stderr;
private static TextReader stdin;
inputEncoding = outputEncoding = Encoding.Default;
}
+ stderr = new UnexceptionalStreamWriter (OpenStandardError (0), outputEncoding);
+ ((StreamWriter)stderr).AutoFlush = true;
+ stderr = TextWriter.Synchronized (stderr, true);
+
#if NET_2_0
-/*
if (ConsoleDriver.IsConsole) {
- CStreamWriter w = new CStreamWriter (OpenStandardError (0), outputEncoding);
- w.AutoFlush = true;
- stderr = TextWriter.Synchronized (w, true);
-
- w = new CStreamWriter (OpenStandardOutput (0), outputEncoding);
+ StreamWriter w = new CStreamWriter (OpenStandardOutput (0), outputEncoding);
w.AutoFlush = true;
- stdout = TextWriter.Synchronized (w, true);
+ stdout = w;
+ stdin = new CStreamReader (OpenStandardInput (0), inputEncoding);
+ ConsoleDriver.Init ();
} else {
- */
#endif
- stderr = new UnexceptionalStreamWriter (OpenStandardError (0), outputEncoding);
- ((StreamWriter)stderr).AutoFlush = true;
- stderr = TextWriter.Synchronized (stderr, true);
-
stdout = new UnexceptionalStreamWriter (OpenStandardOutput (0), outputEncoding);
((StreamWriter)stdout).AutoFlush = true;
stdout = TextWriter.Synchronized (stdout, true);
+ stdin = new UnexceptionalStreamReader (OpenStandardInput (0), inputEncoding);
+ stdin = TextReader.Synchronized (stdin);
#if NET_2_0
- //}
+ }
#endif
- stdin = new UnexceptionalStreamReader (OpenStandardInput (0), inputEncoding);
- stdin = TextReader.Synchronized (stdin);
GC.SuppressFinalize (stdout);
GC.SuppressFinalize (stderr);
GC.SuppressFinalize (stdin);
#if NET_2_0
public static int Read ()
{
- if (ConsoleDriver.IsConsole) {
+ if ((stdin is CStreamReader) && ConsoleDriver.IsConsole) {
return ConsoleDriver.Read ();
} else {
return stdin.Read ();
public static string ReadLine ()
{
- if (ConsoleDriver.IsConsole) {
+ if ((stdin is CStreamReader) && ConsoleDriver.IsConsole) {
return ConsoleDriver.ReadLine ();
} else {
return stdin.ReadLine ();
namespace System {
class ConsoleDriver {
- static IConsoleDriver driver;
+ internal static IConsoleDriver driver;
static bool is_console;
static bool called_isatty;
static ConsoleDriver ()
{
- if (Environment.IsRunningOnWindows) {
+ if (!IsConsole) {
+ driver = new NullConsoleDriver ();
+ } else if (Environment.IsRunningOnWindows) {
driver = new WindowsConsoleDriver ();
} else {
driver = new TermInfoDriver (Environment.GetEnvironmentVariable ("TERM"));
targetLeft, targetTop, sourceChar, sourceForeColor, sourceBackColor);
}
+ public static void Init ()
+ {
+ driver.Init ();
+ }
+
public static int Read ()
{
return ReadKey (false).KeyChar;
namespace System {
[Serializable]
public struct ConsoleKeyInfo {
+ internal static ConsoleKeyInfo Empty = new ConsoleKeyInfo ('\0', 0, false, false, false);
ConsoleKey key;
char keychar;
ConsoleModifiers modifiers;
int WindowTop { get; set; }
int WindowWidth { get; set; }
+ void Init ();
void Beep (int frequency, int duration);
void Clear ();
void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight,
--- /dev/null
+//
+// System.NullConsoleDriver
+//
+// Author:
+// Gonzalo Paniagua Javier (gonzalo@ximian.com)
+//
+// (C) 2006 Novell, Inc. (http://www.novell.com)
+//
+
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System.Runtime.InteropServices;
+using System.Text;
+namespace System {
+ class NullConsoleDriver : IConsoleDriver {
+ public ConsoleColor BackgroundColor {
+ get { return ConsoleColor.Black; }
+ set {
+ }
+ }
+
+ public int BufferHeight {
+ get { return 0; }
+ set {}
+ }
+
+ public int BufferWidth {
+ get { return 0; }
+ set {}
+ }
+
+ public bool CapsLock {
+ get { return false; }
+ }
+
+ public int CursorLeft {
+ get { return 0; }
+ set {}
+ }
+
+ public int CursorSize {
+ get { return 0; }
+ set { }
+ }
+
+ public int CursorTop {
+ get { return 0; }
+ set {}
+ }
+
+ public bool CursorVisible {
+ get { return false; }
+ set {}
+ }
+
+ public bool Echo { // not really used on windows
+ get { return true; }
+ set {}
+ }
+
+ public ConsoleColor ForegroundColor {
+ get { return ConsoleColor.Black; }
+ set {}
+ }
+
+ public bool KeyAvailable {
+ get { return false; } // FIXME: throw?
+ }
+
+ public bool Initialized {
+ get { return true; }
+ }
+
+ public int LargestWindowHeight {
+ get { return 0; }
+ }
+
+ public int LargestWindowWidth {
+ get { return 0; }
+ }
+
+ public bool NumberLock {
+ get { return false; }
+ }
+
+ public string Title {
+ get { return ""; }
+ set {}
+ }
+
+ public bool TreatControlCAsInput {
+ get { return false; }
+ set {}
+ }
+
+ public int WindowHeight {
+ get { return 0; }
+ set {}
+ }
+
+ public int WindowLeft {
+ get { return 0; }
+ set {}
+ }
+
+ public int WindowTop {
+ get { return 0; }
+ set {}
+ }
+
+ public int WindowWidth {
+ get { return 0; }
+ set {}
+ }
+
+ public void Beep (int frequency, int duration)
+ {
+ }
+
+ public void Clear ()
+ {
+ }
+
+ public void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight,
+ int targetLeft, int targetTop, Char sourceChar,
+ ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
+ {
+ }
+
+ public void Init ()
+ {
+ }
+
+ public string ReadLine ()
+ {
+ return null;
+ }
+
+ public ConsoleKeyInfo ReadKey (bool intercept)
+ {
+ return ConsoleKeyInfo.Empty;
+ }
+
+ public void ResetColor ()
+ {
+ }
+
+ public void SetBufferSize (int width, int height)
+ {
+ }
+
+ public void SetCursorPosition (int left, int top)
+ {
+ }
+
+ public void SetWindowPosition (int left, int top)
+ {
+ }
+
+ public void SetWindowSize (int width, int height)
+ {
+ }
+ }
+}
+#endif
+
using System.Collections;
using System.IO;
using System.Text;
+using System.Runtime.InteropServices;
namespace System {
class TermInfoDriver : IConsoleDriver {
static string [] locations = { "/etc/terminfo", "/usr/share/terminfo", "/usr/lib/terminfo" };
string clear;
string bell;
string term;
- Stream stdout;
Stream stdin;
- byte verase;
+ internal byte verase;
byte vsusp;
byte intr;
if (str == null)
return;
- Console.Write (str);
+ ((CStreamWriter) Console.stdout).InternalWriteString (str);
}
public TermInfoDriver ()
if (reader == null)
reader = new TermInfoReader (term, KnownTerminals.ansi);
-
- Init ();
}
public bool Initialized {
get { return inited; }
}
- void Init ()
+ public void Init ()
{
if (inited)
return;
if (!ConsoleDriver.TtySetup (endString, out verase, out vsusp, out intr))
throw new IOException ("Error initializing terminal.");
- stdout = Console.OpenStandardOutput (0);
stdin = Console.OpenStandardInput (0);
clear = reader.Get (TermInfoStrings.ClearScreen);
bell = reader.Get (TermInfoStrings.Bell);
return 0;
}
+ public bool NotifyWrite (ConsoleKeyInfo key)
+ {
+ if (key.Key >= ConsoleKey.A && key.Key <= ConsoleKey.Z) {
+ cursorLeft++;
+ if (cursorLeft >= WindowWidth) {
+ cursorTop++;
+ cursorLeft = 0;
+ if (cursorTop >= WindowHeight) {
+ cursorTop--;
+ }
+ }
+ return true;
+ }
+ switch (key.Key) {
+ case ConsoleKey.Backspace:
+ if (cursorLeft > 0) {
+ cursorLeft--;
+ SetCursorPosition (cursorLeft, cursorTop);
+ WriteConsole (" ");
+ SetCursorPosition (cursorLeft, cursorTop);
+ }
+ return false;
+ case ConsoleKey.Tab:
+ break;
+ case ConsoleKey.Clear:
+ break;
+ case ConsoleKey.Enter:
+ break;
+ case ConsoleKey.Pause:
+ break;
+ case ConsoleKey.Escape:
+ break;
+ case ConsoleKey.Spacebar:
+ break;
+ case ConsoleKey.PageUp:
+ break;
+ case ConsoleKey.PageDown:
+ break;
+ case ConsoleKey.End:
+ break;
+ case ConsoleKey.Home:
+ break;
+ case ConsoleKey.LeftArrow:
+ break;
+ case ConsoleKey.UpArrow:
+ break;
+ case ConsoleKey.RightArrow:
+ break;
+ case ConsoleKey.DownArrow:
+ break;
+ case ConsoleKey.Select:
+ break;
+ case ConsoleKey.Print:
+ break;
+ case ConsoleKey.Execute:
+ break;
+ case ConsoleKey.PrintScreen:
+ break;
+ case ConsoleKey.Insert:
+ break;
+ case ConsoleKey.Delete:
+ break;
+ case ConsoleKey.Help:
+ break;
+ case ConsoleKey.D0:
+ break;
+ case ConsoleKey.D1:
+ break;
+ case ConsoleKey.D2:
+ break;
+ case ConsoleKey.D3:
+ break;
+ case ConsoleKey.D4:
+ break;
+ case ConsoleKey.D5:
+ break;
+ case ConsoleKey.D6:
+ break;
+ case ConsoleKey.D7:
+ break;
+ case ConsoleKey.D8:
+ break;
+ case ConsoleKey.D9:
+ break;
+ case ConsoleKey.LeftWindows:
+ break;
+ case ConsoleKey.RightWindows:
+ break;
+ case ConsoleKey.Applications:
+ break;
+ case ConsoleKey.Sleep:
+ break;
+ case ConsoleKey.NumPad0:
+ break;
+ case ConsoleKey.NumPad1:
+ break;
+ case ConsoleKey.NumPad2:
+ break;
+ case ConsoleKey.NumPad3:
+ break;
+ case ConsoleKey.NumPad4:
+ break;
+ case ConsoleKey.NumPad5:
+ break;
+ case ConsoleKey.NumPad6:
+ break;
+ case ConsoleKey.NumPad7:
+ break;
+ case ConsoleKey.NumPad8:
+ break;
+ case ConsoleKey.NumPad9:
+ break;
+ case ConsoleKey.Multiply:
+ break;
+ case ConsoleKey.Add:
+ break;
+ case ConsoleKey.Separator:
+ break;
+ case ConsoleKey.Subtract:
+ break;
+ case ConsoleKey.Decimal:
+ break;
+ case ConsoleKey.Divide:
+ break;
+ case ConsoleKey.F1:
+ break;
+ case ConsoleKey.F2:
+ break;
+ case ConsoleKey.F3:
+ break;
+ case ConsoleKey.F4:
+ break;
+ case ConsoleKey.F5:
+ break;
+ case ConsoleKey.F6:
+ break;
+ case ConsoleKey.F7:
+ break;
+ case ConsoleKey.F8:
+ break;
+ case ConsoleKey.F9:
+ break;
+ case ConsoleKey.F10:
+ break;
+ case ConsoleKey.F11:
+ break;
+ case ConsoleKey.F12:
+ break;
+ case ConsoleKey.F13:
+ break;
+ case ConsoleKey.F14:
+ break;
+ case ConsoleKey.F15:
+ break;
+ case ConsoleKey.F16:
+ break;
+ case ConsoleKey.F17:
+ break;
+ case ConsoleKey.F18:
+ break;
+ case ConsoleKey.F19:
+ break;
+ case ConsoleKey.F20:
+ break;
+ case ConsoleKey.F21:
+ break;
+ case ConsoleKey.F22:
+ break;
+ case ConsoleKey.F23:
+ break;
+ case ConsoleKey.F24:
+ break;
+ case ConsoleKey.BrowserBack:
+ break;
+ case ConsoleKey.BrowserForward:
+ break;
+ case ConsoleKey.BrowserRefresh:
+ break;
+ case ConsoleKey.BrowserStop:
+ break;
+ case ConsoleKey.BrowserSearch:
+ break;
+ case ConsoleKey.BrowserFavorites:
+ break;
+ case ConsoleKey.BrowserHome:
+ break;
+ case ConsoleKey.VolumeMute:
+ break;
+ case ConsoleKey.VolumeDown:
+ break;
+ case ConsoleKey.VolumeUp:
+ break;
+ case ConsoleKey.MediaNext:
+ break;
+ case ConsoleKey.MediaPrevious:
+ break;
+ case ConsoleKey.MediaStop:
+ break;
+ case ConsoleKey.MediaPlay:
+ break;
+ case ConsoleKey.LaunchMail:
+ break;
+ case ConsoleKey.LaunchMediaSelect:
+ break;
+ case ConsoleKey.LaunchApp1:
+ break;
+ case ConsoleKey.LaunchApp2:
+ break;
+ case ConsoleKey.Oem1:
+ break;
+ case ConsoleKey.OemPlus:
+ break;
+ case ConsoleKey.OemComma:
+ break;
+ case ConsoleKey.OemMinus:
+ break;
+ case ConsoleKey.OemPeriod:
+ break;
+ case ConsoleKey.Oem2:
+ break;
+ case ConsoleKey.Oem3:
+ break;
+ case ConsoleKey.Oem4:
+ break;
+ case ConsoleKey.Oem5:
+ break;
+ case ConsoleKey.Oem6:
+ break;
+ case ConsoleKey.Oem7:
+ break;
+ case ConsoleKey.Oem8:
+ break;
+ case ConsoleKey.Oem102:
+ break;
+ case ConsoleKey.Process:
+ break;
+ case ConsoleKey.Packet:
+ break;
+ case ConsoleKey.Attention:
+ break;
+ case ConsoleKey.CrSel:
+ break;
+ case ConsoleKey.ExSel:
+ break;
+ case ConsoleKey.EraseEndOfFile:
+ break;
+ case ConsoleKey.Play:
+ break;
+ case ConsoleKey.Zoom:
+ break;
+ case ConsoleKey.NoName:
+ break;
+ case ConsoleKey.Pa1:
+ break;
+ case ConsoleKey.OemClear:
+ break;
+ default:
+ return true;
+ }
+ return true;
+ }
+
+ public bool NotifyWrite (char val)
+ {
+ if (val == verase) {
+ string str = reader.Get (TermInfoStrings.EraseChars);
+ if (str != null) {
+ Console.Error.WriteLine ("{0}", TermInfoReader.Escape (str));
+ } else {
+ Console.Error.WriteLine ("FUCK");
+ }
+ return false;
+ } else {
+ //TODO: compute cursor position
+ return true;
+ }
+ }
+
public ConsoleColor BackgroundColor {
get { return bgcolor; }
set {
public int CursorLeft {
get {
- GetCursorPosition ();
return cursorLeft;
}
set {
public int CursorTop {
get {
- GetCursorPosition ();
return cursorTop;
}
set {
return;
noEcho = !value;
- ConsoleDriver.SetEcho (value);
}
}
Echo = true;
StringBuilder builder = new StringBuilder ();
bool exit = false;
+ CStreamWriter writer = (CStreamWriter) Console.stdout;
do {
ConsoleKeyInfo key = ReadKeyInternal ();
char c = key.KeyChar;
exit = (c == '\n');
if (!exit)
builder.Append (c);
- stdout.WriteByte ((byte) c);
+ writer.WriteKey (key);
} while (!exit);
if (prevEcho == false)
Echo = prevEcho;
throw new ArgumentException (String.Empty, "Cannot write to the specified coordinates.");
}
+ public void Init ()
+ {
+ }
+
public string ReadLine ()
{
StringBuilder builder = new StringBuilder ();