Description of the new feature
I noticed that the conpty uses a signal pipe for sending certain messages.
https://github.com/microsoft/terminal/blob/b888cb7e4c3b0b21b7ed66c224bcdf7fa9ef6d9a/src/winconpty/winconpty.cpp#L166
However, it is created via the Win32 API CreatePipe, which means it does not support Overlapped IO. I believe this design led WT to create a separate thread for this functionality because anonymous pipes always block on reads.
https://github.com/microsoft/terminal/blob/b888cb7e4c3b0b21b7ed66c224bcdf7fa9ef6d9a/src/host/PtySignalInputThread.cpp#L17-L21
I think this is not ideal. WT already uses NtCreateFile to bypass the restricted Win32 API and create an anonymous pipe that supports Overlapped IO, so I think we can definitely use that approach to create PtySignalPipe, thereby avoiding this unnecessary thread and the synchronization overhead for it.
https://github.com/microsoft/terminal/blob/b888cb7e4c3b0b21b7ed66c224bcdf7fa9ef6d9a/src/types/utils.cpp#L767-L784
Proposed technical implementation details
No response