Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Terminal initialization and (non-)interactive shells
- X-seq: zsh-workers 5130
- From: Drazen Kacar <dave@xxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Terminal initialization and (non-)interactive shells
- Date: Mon, 1 Feb 1999 01:50:01 +0100
- Cc: Drazen Kacar <dave@xxxxxxx>, zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <990130124135.ZM13173@xxxxxxxxxxxxxxxxxxxxxxx>; from Bart Schaefer on Sat, Jan 30, 1999 at 12:41:35PM -0800
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <9901301251.AA43826@xxxxxxxxxxxxxxxxx> <990130100451.ZM12586@xxxxxxxxxxxxxxxxxxxxxxx> <19990130192746.A20234@xxxxxxxxxxxxx> <990130124135.ZM13173@xxxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
> } Bart Schaefer wrote:
> }
> } > (For Drazen) Is it desirable to ALWAYS do this? For a backgrounded shell,
> } > calling ioctl() on a tty device will usually result in a SIGTTOU stopping
> } > the process.
> Every zsh, foreground or background, calls init_io(), which in turn does all
> the tty initialization if isatty(0). There's no test for `interactive'.
>
> This is, arguably, wrong.
I did some checking on Solaris 7. TIOCNXCL is handled by ttcompat streams
module, which provides 4BSD streams compatibility (struct sgttyb things).
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.
Besides, isatty(0) for background shell [checked with (echo foo >/dev/tty)& ]
doesn't return 1.
--
.-. .-. Life is a sexually transmitted disease.
(_ \ / _)
| dave@xxxxxxx
| dave@xxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author