This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Win PTY library.


On 9/15/2012 9:21 AM, Christopher Faylor wrote:
> On Sat, Sep 15, 2012 at 12:15:49PM -0400, Earnie Boyd wrote:
>> I just discovered https://github.com/rprichard/winpty and thought
>> Cygwin users and developers may be interested.  The license is MIT
>> style.
> 
> Looks interesting.  I've had something similar sitting around in my
> Cygwin sandbox for a while.  It would be nice to have a real console-based
> pty implementation.

Unfortunately, this program works by polling and scraping a hidden console
window. Any approach of this type will lose data. (No, you can't synchronize
your scraping by using console accessibility APIs because conhost calls out into
accessibility with its locks held, and if you try to read the console buffer in
this context, you deadlock.)

The best userspace solution would be chained DLL injection, but this approach
has its own problems --- the console handle can get decoupled from the DLL
injection in a number of ways. The most robust approach would be an NT filter
driver attached to the console driver itself. That'd only work on systems with a
non-insane console layer (i.e., post-Vista systems), and you'd have to figure
out the internal console communication protocol.

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]