From Microsoft: Windows 10 Console and Cygwin
Mon May 4 22:35:00 GMT 2015
On May 1 18:51, Rich Eizenhoefer wrote:
> Hi Corinna,
> I spent most of the day yesterday and part of this AM talking with
> console devs and going through the windows codebase to understand the
> changes between Vista and W7 (and now). The regression in
> functionality wasn't inadvertent, but related to security.
Oh, ok. W7 introduced the conhost.exe process as well. Was that part of the security consideration or was the windowstation change a result of changing to a process-based model?
The tribal knowledge of what drove the change is seeming lost in time. There are no comments in the code base discussing it, nor can we find any legacy specs. There is a reference to the security change being made, but not to the why.
- I'm on vacation for a while now so my replies will be a bit sluggish
and testing anything will have to wait, too. I hope that's ok.
- Tonight it occured to me to ask you another question:
For a long time Cygwin is emulating pseudo ttys using named pipes.
This works fine for Cygwin applications, but it has some downside
when using non-Cygwin executables. MSVCRT's isatty() function
returns 0 for named pipes, because it's (obviously) not aware of
Cygwin's pseudo tty functionality. As a result, many non-Cygwin
console applications misbehave in Cygwin terminals or remote ssh
sessions as soon as it comes to user input or paging.
Two possible solutions for this problem come to mind:
- Either MSVCRT's isatty function recognizes named pipes used as
Cygwin PTYs. That's not tricky because the name of the pipe is a
simple indicator. But I could understand a certain reluctance,
because that would require the MSVCRT guys to support this solution.
- Or the console API could be extended (or even just documented as far
as it exists) so that the Cygwin PTY implementation could use
console handles under the hood, rather than named pipes. For that
to work, the PTY master side would have to have been able to create
console handles and connect to the master side of them, basically
the side which right now conhost.exe is attached to.
Do you see a chance to open this API up to allow other processes
than conhost to create the master side of a console, aka a PTY
in POSIX speak? Or is there already an existing solution I just
I've created a backlog item for this request so we can track the ask. It's possible, but would probably need to pick your brain in-depth more about the ask in the future. In the meantime, is it okay if I attach a copy of this email thread to the internal tracking item in our database? If not, I'll just keep the summary that I've already added.
More information about the Cygwin