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

Terminal initialization and (non-)interactive shells



On Jan 30,  7:27pm, Drazen Kacar wrote:
} Subject: Re: PATCH: (more) Re: PATCH: 3.1.5* & 3.0.5: Re: strange xterm & 
}
} 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.
} 
} Just for the first interactive shell on the terminal. Background shell
} doesn't fall in that category. But why should a background shell attempt
} to initialize the terminal? It seems to me that background shell shouldn't
} call that function. On a related matter, does subshell initialize terminal?

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.

Another init_io(), but this time only for interactive shells, happens if/when
"exec < /dev/foo" is run and foo is a tty device.

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




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