Mono.UnixUtils.isatty C# (CSharp) Метод

isatty() публичный статический Метод

public static isatty ( int fd ) : bool
fd int
Результат bool
		public static bool isatty (int fd)
		{
			try {
				return _isatty (fd) == 1;
			} catch {
				return false;
			}
		}
	}

Usage Example

Пример #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.");
            }
        }
All Usage Examples Of Mono.UnixUtils::isatty