Re: https://github.com/microsoft/terminal/blob/main/samples/ConPTY/MiniTerm/MiniTerm/Terminal.cs (Sample Code for pseudoconsole)

Carso 1 Reputation point
2021-12-21T18:53:50.88+00:00

private static void CopyPipeToOutput(SafeFileHandle outputReadSide)
{
using (var terminalOutput = Console.OpenStandardOutput())
using (var pseudoConsoleOutput = new FileStream(outputReadSide, FileAccess.Read))
{
pseudoConsoleOutput.CopyTo(terminalOutput);
}
}

Above code from sample reads PseudoConsole output and copies it to the terminal's standard out. Setting a breakpoint only works when the terminal is first started but never subsequently gets hit. I'm trying to intercept the pseudoconsole output and send it to a socket. Any thoughts are greatly appreciated. Thanks!

Developer technologies .NET .NET CLI
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.