isatty() public static method

public static isatty ( int fd ) : bool
fd int
return bool
示例#1
0
        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.");
            }
        }
示例#2
0
        void InitTerminal()
        {
            isatty = UnixUtils.isatty(0) && UnixUtils.isatty(1);

            // 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)
            {
                Console.WriteLine("Mono C# Shell, type \"help;\" for help\n\nEnter statements below.");
            }
        }