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

Re: Background jobs and notification (stdout vs stderr)



Vincent Lefevre wrote:
> Let's consider:
> 
> greux:~> sleep 2&
> [1] 20823
> greux:~>
> [1]  + done       sleep 2
> greux:~>
> 
> The "[1] 20823" line is sent to stderr, whereas the "[1]  + done ..."
> line is sent to stdout (I could see that with the coloring of stderr).
> Is there any reason?

Asynchronous notifications are currently set up to go direct to the
terminal.  It's actually the duplicated fd used for terminal handling
rather than stdout, but they're typically the same unless you try to
redirect stdout.

I think this is probably because you don't usually want asynchronous job
notifications mixed in with other error text, since they're nothing to
do with what's actually running: job control is specifically interactive.
Note that the interaction with the terminal output is inevitable, that's
why you get the editing buffer cleard and the prompt reprinted
afterwards.  I don't think you can redirect them without messing up
terminal editing.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



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