1
0
mirror of https://github.com/livingcomputermuseum/IFS.git synced 2026-03-04 02:34:38 +00:00

Don't use console if redirected.

This is a brute-force solution, but the existing console code will hit errors if there is no console.
This commit is contained in:
Ken Shirriff
2017-11-18 17:11:34 -08:00
parent b6ea7b4d07
commit 22a9bbac1a

View File

@@ -19,7 +19,7 @@ using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.IO;
using System.Threading;
namespace IFS.IfsConsole
{
@@ -162,6 +162,13 @@ namespace IFS.IfsConsole
public void Run()
{
if (Console.IsOutputRedirected || Console.IsInputRedirected)
{
// No console, so just run forever.
Thread.Sleep(Timeout.Infinite);
return;
}
bool exit = false;
while (!exit)
{