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

Re: jobs -d &>/dev/null still produces output?



On Fri, 3 Nov 2006 14:59:07 -0500
"Matt Wozniski" <godlygeek@xxxxxxxxx> wrote:
> On 11/3/06, Peter Stephenson <pws@xxxxxxx> wrote:
> > "Matt Wozniski" <godlygeek@xxxxxxxxx> wrote:
> > > sleep 1000 &
> > > jobs -d &>/dev/null
> > >
> > > Why does this still produce output?
> >
> > The line you're seeing is the same line that would usually be produced
> > when, for example, you run "fg" and the process that's brought to the
> > foreground is running in a different directory.  Since this is purely an
> > interactive informational message it's directed straight to the terminal.
>
> On a machine that I can't use the latest cvs on:  Is there any sort of
> file descriptor magic that I can use to work around this and get it to
> send that to somewhere other than the terminal, or am I just stuck
> with its current behavior?

I can't think of anything you can do in the shell:  it's hard-wired to
the terminal so you would somehow have to persuade the output to come back
from it.  There's no use using a pseudoterminal since you can't change
the terminal of the shell that's actually running... unless there's some
fiendishly clever trick using the zsh/clone module of cloning the shell
into a new pseudoterminal.  I couldn't get this to work with zsh/zpty since
(I think) clone doesn't get passed the new terminal early enough.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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