Issue: Reading from stdin in Cywin64 Terminal (first noticed with Git Bash) with a .Net framework application hangs after some time

Nitro Vent
Wed Mar 3 15:11:30 GMT 2021

I have two .Net console applications targeting .Net Framework 4.7.2,
"produce.exe" and "consume.exe" with their respective sources

using System;using System.Threading;
namespace Produce
    class Program
        static void Main(string[] args)
            Console.WriteLine("Hello World.");


using System;
namespace Consume
    class Program
        static void Main(string[] args)
            var input = Console.In.ReadToEnd();


$ ./produce.exe | ./consume.exe

in Cygwin Terminal I expect the output to be

Hello World.

But there is no output and the second process, consume.exe, hangs at
This was verified by looking at the running processes with ps aux when
running the consume.exe in the background as well as by attaching the
Visual Studio debugger.

Piping produce.exe into cat works correctly.
Piping some more content into consume.exe also fails (e.g. find * /usr |
Executing the same command in Windows Command works correctly.

Notice that piping into consume.exe works if there is no delay in the

I had first opened this issue on Github in the git-for-windows project, as
I experienced the issue with Git Bash in Windows first:

I then installed the current version of Cygwin and could replicate the same
issue there.

PS: I have not attached the output of cygcheck because it would reveal
information of my work environment I will not share.



More information about the Cygwin mailing list