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

Re: Terminal initialization and (non-)interactive shells



On Feb 1,  1:50am, Drazen Kacar wrote:
} Subject: Re: Terminal initialization and (non-)interactive shells
}
} An ioctl(TIOCNXCL) call from background process succeeds in unlocking
} the terminal device. Man page doesn't say a thing about this, but I think
} it's safe to put it anywhere. I don't know about non-Solaris systems.

By the time I sent my second message, I wasn't referring just to TIOCNXCL
any more; it's the whole terminal setup block in init_io() that is a problem.

} Besides, isatty(0) for background shell [checked with (echo foo >/dev/tty)& ]
} doesn't return 1.

I'm not sure how that let you check it, but strace on my linux system shows
that isatty(0) most definitely does return 1.  Note that I'm not talking
about background subshells -- I'm talking about `/usr/local/bin/zsh &`.
attachtty() most definitely gets stopped with at SIGTTOU in any background
shell that happens to call it.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com




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