[PATCH v2] Cygwin: pty: Revise code waiting for forwarding again.

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Jan 24 11:07:00 GMT 2020


On Jan 23 23:16, Takashi Yano wrote:
> On Thu, 23 Jan 2020 13:51:54 +0100
> Corinna Vinschen wrote:
> > On Jan 23 13:30, Takashi Yano wrote:
> > > - After commit 6cc299f0e20e4b76f7dbab5ea8c296ffa4859b62, outputs of
> > >   cygwin programs which call both printf() and WriteConsole() are
> > >   frequently distorted. This patch reverts waiting function to dumb
> > >   Sleep().
> > 
> > I understand the need for this change, but isn't there any other
> > way to detect if the pseudo console being ready?  E. g., something
> > in the HPCON_INTERNAL struct or so?
> 
> As for HPCON_INTERNAL,
> 
> typedef struct _HPCON_INTERNAL
> {
>   HANDLE hWritePipe;
>   HANDLE hConDrvReference;
>   HANDLE hConHostProcess;
> } HPCON_INTERNAL;
> 
> hWritePipe:
> This is for sending window size change message to pseudo console
> (conhost.exe process).
> 
> hConDrvRererence:
> I am not sure what this is for.
> 
> hConHostProcess:
> Process handle of conhost.exe process.
> 
> None of them seems able to be used for that purpose.

Too bad.  It's pretty strange that CreatePseudoConsole returns a
valid HPCON but then isn't ready to take input immediately.

> I do not come up with other implementation so far.
> 
> Let me consider a while.

I wonder how others solve this problem.  I see that the native OpenSSH
is using Sleeps, too, in their start_with_pty() function, calling
AttachConsole in a loop, but I'm not sure if these are related to pseudo
console usage.  The commit message don't explain anything there :(


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20200124/b5b68ca0/attachment.sig>


More information about the Cygwin-patches mailing list