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

Re: pipe issues with 'jobs' command



--- Sweth Chandramouli <svc@xxxxxxxxx> wrote:
> On Sun, Oct 28, 2001 at 08:37:48PM -0500, Le Wang
> wrote:
> > Pretty weird, eh?
> 	Not really; this is the expected behaviour.  This
> was
> just discussed in another thread earlier this month;
> search the archives
> for the thread "get the number of active jobs to
> show in the prompt?".
> 
> 	-- Sweth.
> 
> -- 
> Sweth Chandramouli ; <svc@xxxxxxxxxxxxxx>
> President, Idiopathic Systems Consulting

okay, thanks a lot.  That's really helpful.  So a
subshell was being created on the lhs of the
pipe...that makes sense.  But looking at the following
code from my .zshrc:

--------------
getJobCount () {
  print "$#jobtexts";
}

prompt_le1_precmd () {
  PS1="$(getJobCount) %# "
  PS2="%_> "
  PS3="?# "
}
--------------

If I call getJobCount from the shell directly (e.g.
execute the command 'getJobCount'), I get the real
number of jobs, but my prompt always prints 0.  What's
going on here?

thanks
-lw

_______________________________________________________
Do You Yahoo!?
Get your free @yahoo.ca address at http://mail.yahoo.ca



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