From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: named jobs in RPROMPT
Date: Sun, 25 Sep 2011 10:39:34 -0700 [thread overview]
Message-ID: <110925103934.ZM19149@torch.brasslantern.com> (raw)
In-Reply-To: <loom.20110920T091456-635@post.gmane.org>
On Sep 20, 7:27am, Daniel wrote:
} Subject: Re: named jobs in RPROMPT
}
} setopt promptsubst
} Now consider:
} RPROMPT='"$jobstates"'
} and
} my_jobs() { print $jobstates }
} RPROMPT='"$(my_jobs)"'
}
} The first one display the jobstates array, the second doesn't.
That's because $(...) is a subshell which has no jobs of its own.
Consider:
sleep 10 & print $jobtexts
print $(sleep 3 >/dev/null & print $jobtexts)
print $jobtexts
} My idea is to have my_jobs print a very compact list of jobs, fitting in
} the right prompt.
Instead of having my_jobs print the list to stdout, which forces you
to create a sub-process whose output can be captured, just have my_jobs
assign the list directly to RPROMPT.
next prev parent reply other threads:[~2011-09-25 17:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 23:42 fhml
2011-09-20 7:27 ` Daniel
2011-09-20 19:04 ` Julien Jehannet
2011-09-25 17:39 ` Bart Schaefer [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-09-18 14:48 Daniel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=110925103934.ZM19149@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).