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

RE: PATCH: Re: zpty and controlling tty (and other fd's)



> >
> > Note fd's 3 and 13. 3 is master side of pty (child does not need it,
> > does it?)
>
> Of course I tried to close it -- and on Linux this messed up the
> parent's (i.e. the shell's) terminal settings. Don't know how this
> came.
>

Well, at least Midnight and Screen do it - so, it is possible. This one
is from Midnight code that spawns subshell. I do not know, how usefulr
it is.

        /* {{{ Open the slave side of the pty: again */
        pty_slave = pty_open_slave (pty_name);

        /* This must be done before closing the master side of the pty,
*/
        /* or it will fail on certain idiotic systems, such as Solaris.
*/

        /* Close master side of pty.  This is important; apart from
*/
        /* freeing up the descriptor for use in the subshell, it also
*/
        /* means that when MC exits, the subshell will get a SIGHUP and
*/
        /* exit too, because there will be no more descriptors pointing
*/
        /* at the master side of the pty and so it will disappear.
*/

        close (subshell_pty);


I do not use Linux, but until this is cleared there - porbably under
#ifndef __LINUX (or whatever)?

-andrej



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