From mboxrd@z Thu Jan 1 00:00:00 1970 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes Resent-Date: Sun, 31 Jan 1999 19:50:39 -0500 (EST) Date: Mon, 1 Feb 1999 01:50:01 +0100 From: Drazen Kacar To: Bart Schaefer Cc: Drazen Kacar , zsh-workers@math.gatech.edu Subject: Re: Terminal initialization and (non-)interactive shells Message-ID: <19990201015001.A11596@jagor.srce.hr> References: <9901301251.AA43826@ibmth.df.unipi.it> <990130100451.ZM12586@candle.brasslantern.com> <19990130192746.A20234@jagor.srce.hr> <990130124135.ZM13173@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i In-Reply-To: <990130124135.ZM13173@candle.brasslantern.com>; from Bart Schaefer on Sat, Jan 30, 1999 at 12:41:35PM -0800 X-Face: 'UIE}WabGB0+U>p-#(hp<_+AD2{H],=qR*jHfm$/e]l0(kU3oOYc5lqG6gg>[\h^IOc{'siD6#!T&loIShgmYHz3#+*D38:|`~\BE,(W~Ol9BDfDwk'lKJ;Z{sY8E9(ME.E]'wvNO`$n#,;9Z`tOFcW/nHZq!BOSrM>V?C<5DTw=<${c{M2V+|)0jSUl&!+8%8nIBF(u:E>SZWM^e X-Attribution: Dave X-Windows: Garbage at your fingertips. Resent-Message-ID: <"UWd_6.0.6J6.VfFjs"@math> Resent-From: zsh-workers@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Resent-Sender: zsh-workers-request@math.gatech.edu X-Mailing-List: 5130 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@srce.hr | dave@fly.cc.fer.hr