Created
September 29, 2011 14:24
-
-
Save migueldeicaza/1250827 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void InitTerminal (bool show_banner) | |
| { | |
| #if ON_DOTNET | |
| is_unix = false; | |
| isatty = true; | |
| #else | |
| int p = (int) Environment.OSVersion.Platform; | |
| is_unix = (p == 4) || (p == 128); | |
| if (is_unix) | |
| isatty = UnixUtils.isatty (0) && UnixUtils.isatty (1); | |
| else | |
| isatty = true; | |
| #endif | |
| // Work around, since Console is not accounting for | |
| // cursor position when writing to Stderr. It also | |
| // has the undesirable side effect of making | |
| // errors plain, with no coloring. | |
| // Report.Stderr = Console.Out; | |
| SetupConsole (); | |
| if (isatty && show_banner) | |
| Console.WriteLine ("Mono C# Shell, type \"help;\" for help\n\nEnter statements below."); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment