Output of a pseudo console (ConPTY) is eaten by Visual Studio debugger #6181

Closed
opened 2026-01-31 00:31:48 +00:00 by claunia · 3 comments
Owner

Originally created by @akobr on GitHub (Jan 28, 2020).

I'm having a strange behavior with running windows application (.NET "Full" Framework) which is listening to a pseudo console and is debugged in Visual Studio.

The output from a pseudo console is eaten by the debugger (shown in VS output window) but it never arrives into the pipe inside the application.

More information is described inside the StackOverflow question.

Originally created by @akobr on GitHub (Jan 28, 2020). I'm having a strange behavior with running windows application _(.NET "Full" Framework)_ which is listening to a pseudo console and is debugged in Visual Studio. The output from a pseudo console is eaten by the debugger _(shown in VS output window)_ but it never arrives into the pipe inside the application. [More information is described inside the StackOverflow question.](https://stackoverflow.com/questions/59937830/an-output-of-pseudo-console-conpty-is-eaten-by-visual-studio-debug-output-wind)
claunia added the Resolution-ExternalNeeds-Tag-Fix labels 2026-01-31 00:31:48 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 31, 2020):

That's a very good question. We've never seen this one before. It is, perhaps, very important to make sure you are not passing the application's Standard Input and Standard Output handles into the new process (ping) when you launch it. Ping's output handle might be redirected because the application's output handle is connected to the debugger.

When the application is launched outside the debugger, it does not have a standard output handle to inherit.

5b31f79d9f/ConPty.Sample.ConsoleApi/Terminal.cs (L42)

Keywords: inherit handle ProcessFactory

Good luck!

@DHowett-MSFT commented on GitHub (Jan 31, 2020): That's a very good question. We've never seen this one before. It is, perhaps, very important to make sure you are **not** passing the application's Standard Input and Standard Output handles into the new process (ping) when you launch it. Ping's output handle might be redirected because the application's output handle is connected to the debugger. When the application is launched outside the debugger, it does not have a standard output handle to inherit. https://github.com/akobr/ConPty.Sample/blob/5b31f79d9f9c8ff2a703d6068027f13986b757c1/ConPty.Sample.ConsoleApi/Terminal.cs#L42 Keywords: inherit handle ProcessFactory Good luck!
Author
Owner

@akobr commented on GitHub (Jan 31, 2020):

Thank you for your reply and tip. I will dive deeply into it, but I thought I'm already disabling the inheritance of handlers:

https://github.com/akobr/ConPty.Sample/blob/master/ConPty.Sample.ConsoleApi/Interop/ProcessFactory.cs#L77

@akobr commented on GitHub (Jan 31, 2020): Thank you for your reply and tip. I will dive deeply into it, but I thought I'm already disabling the inheritance of handlers: https://github.com/akobr/ConPty.Sample/blob/master/ConPty.Sample.ConsoleApi/Interop/ProcessFactory.cs#L77
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 31, 2020):

Ah! I didn't realize ProcessFactory was part of ConPty.Sample. You may need to explicitly set the handles to NULL and set STARTF_USESTDHANDLES.

@DHowett-MSFT commented on GitHub (Jan 31, 2020): Ah! I didn't realize ProcessFactory was part of ConPty.Sample. You may need to explicitly set the handles to NULL and set STARTF_USESTDHANDLES.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6181