在Mono中读取后,过程输出无法正确显示

时间:2014-10-10 14:01:45

标签: c# mono

我似乎遇到了可能是单声道的错误,或者我做错了什么。

我使用子进程通过C#做事情但是在某些情况下终端因没有显示我正确键入的内容而中断。在使用控制台读取一行后,我设法让这件事发生了。

我目前在Mac上使用单声道版Mono JIT编译器版本3.10.0,但不知道这是单声道还是可以在Windows上发生。

我能够重新创建错误的最小代码如下:

using System;
using System.Diagnostics;

namespace Test
{
    class MainClass
    {
        public static void Main( string[] args )
        {
            Console.ReadLine();

            Process.Start("tee","text.txt").WaitForExit();            
        }
    }
}

如果删除读取线,则在输入后将打印tee的输出(因此您将看到相同的线两次)但是使用读取线它只显示tee的输出,而不是您键入的输入< / p>

IE: 没有读取行

~/test $ mcs program.cs && mono program.exe
this 
this 
is 
is 
writting 
writting 
to 
to 
file 
file 
^C 

~/test $ cat text.txt 
this
is
writting
to
file

使用读取行

~/test $ mcs program.cs && mono program.exe
readline
this
should
be 
printing
as well

~/test $ cat text.txt
this
should
be 
printing
as well

0 个答案:

没有答案