Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Fix for zpty under Cygwin



On May 7, 10:15pm, áÎÄÒÅÊ âÏÒÚÅÎËÏ× wrote:
> Subject: Fix for zpty under Cygwin
>  
> It was O_NOCTTY. Looks like O_NOCTTY is "sticky" under Cygwin and
> prevents this tty from becoming ctty when dup()'ing it later. I do not
> remeber when it was put in, so there are two possibilities:
> 
> - we added this and that broke things

That's probably it; I copied that part from clone.c along with several
other changes (rev 1.15).

> So the fix under Cygwin is quite simple - just remove O_NOCTTY.
> Actually, I wonder what it does here at all - it is exactly the
> descriptor that *will* be ctty later.

It will be ctty in the forked-off child that runs on the pty, but we have
to open the descriptor originally in the parent before forking.  O_NOCTTY
is to prevent the pty from becoming the parent's controlling terminal.

> Related problem is testing. Completion tests consistently failed; the
> reason was this line in comptest:
>
> zpty -b zsh "$comptest_zsh -f +Z"

The -b was added in 13035 when non-blocking mode was the default and -b
selected blocking mode, then never removed when the default switched again
in 13120.  This was my error; the -b should not be there.



Messages sorted by: Reverse Date, Date, Thread, Author