This is the mail archive of the
mailing list for the Cygwin project.
RE: From Microsoft: Windows 10 Console and Cygwin
- From: Rich Eizenhoefer <riche at microsoft dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Mon, 4 May 2015 19:51:43 +0000
- Subject: RE: From Microsoft: Windows 10 Console and Cygwin
- Authentication-results: sourceware.org; auth=none
- Authentication-results: cygwin.com; dkim=none (message not signed) header.d=none;
- References: <BY1PR03MB1436C656CEF12387D40CD74EB4D70 at BY1PR03MB1436 dot namprd03 dot prod dot outlook dot com> <20150429200616 dot GL3657 at calimero dot vinschen dot de> <BN3PR03MB14300D5567A2F7D86BB69A28B4D70 at BN3PR03MB1430 dot namprd03 dot prod dot outlook dot com> <20150430082231 dot GB19795 at calimero dot vinschen dot de> <BN3PR03MB1430B88AED4339821C7D95BEB4D50 at BN3PR03MB1430 dot namprd03 dot prod dot outlook dot com> <20150502133833 dot GB12723 at calimero dot vinschen dot de>
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.