X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0	tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
X-Mail-Handler: Dyn Standard SMTP by Dyn
X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX18wQzN1Kpa1atc6vuup2HrC
Date: Mon, 17 Sep 2012 09:48:55 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Win PTY library.
Message-ID: <20120917134855.GC16552@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <CA+sc5mnmVykGQLMvf3GXnf5RUM3SHVP6C5PreJ+F4dSksX3+Sw@mail.gmail.com> <20120915162136.GB25529@ednor.casa.cgf.cx> <5057036D.3080304@dancol.org> <5057254C.4040405@cwilson.fastmail.fm> <CAKw7uVjiM-M8xd1o24HAb4-axTpOzugnW1KOFm05DOVCN9+6Vg@mail.gmail.com> <CAKw7uVgZEezTZZ19tXbi=KpySzSxFEbZysUSQsrqOWiVh_ttMg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAKw7uVgZEezTZZ19tXbi=KpySzSxFEbZysUSQsrqOWiVh_ttMg@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Mon, Sep 17, 2012 at 03:42:14PM +0200, V??clav Zeman wrote:
>On 17 September 2012 15:27, Charles Wilson wrote:
>>
>> On 9/17/2012 7:03 AM, Daniel Colascione wrote:
>> > 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.)
>>
>>Well, that's exactly what Console2 does, and it works pretty well.
>>I've never seen any "missing" data when using it.  I don't know what
>>they're doing to work around the deadlock issue, but whatever it is it
>>works.
>
>I think that the difference is that PTY is a stream of commands that
>get interpreted, OTOH, polled Windows console can provide only a
>snapshot at some point in time.  It seems that it would be hard to
>produce faithful stream of commands from this console snapshot.
>Because Console2 is only visualizing the snapshot in its own GUI
>window, it does not matter that it is doing that by snapshotting the
>hidden console.  But for the PTY abstraction, a faithful chain of
>commands seems necessary.  I think that any such polling based
>implementation could miss some transitions in the PTY state in between
>the polls.

I don't see why this matters more for a pty than for Console2.

But, rather than theorize that this doesn't work why not just point to
code to prove it?  These kind of discussions don't have to be opinions
thanks to the wonders of open source.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

