zsh-users
 help / color / mirror / code / Atom feed
From: Dan Nelson <dnelson@emsphone.com>
To: Zefram <zefram@tao.co.uk>, pumilia@est.it
Cc: zsh-users@math.gatech.edu
Subject: Re: A job signaller
Date: Thu, 29 Oct 1998 12:19:53 -0600	[thread overview]
Message-ID: <19981029121953.A7145@emsphone.com> (raw)
In-Reply-To: <199810291358.NAA23600@diamond.tao.co.uk>; from "Zefram" on Thu Oct 29 13:58:23 GMT 1998

In the last episode (Oct 29), Zefram said:
> Paolo Pumilia wrote:
> >Is there a way to put a mark within the prompt string to
> >inform the user that jobs are still running from that shell?
> >(e.g +/-: "+" for running or stopped jobs; "-" for no jobs)
> 
> I use something like this:
> 
> precmd () {
>   if jobs % >& /dev/null; then
>     psvar=("")
>   else
>     psvar=()
>   fi
> }
> PS1="%(1v:+:-)> "

Note that a side-effect of this is that an "exit" will not warn you
that you have jobs running.  The "jobs" comand in the precmd() function
clears the variable that would cause the warning to be printed.

	-Dan Nelson
	dnelson@emsphone.com


  reply	other threads:[~1998-10-29 18:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-29 13:36 Paolo Pumilia
1998-10-29 13:58 ` Zefram
1998-10-29 18:19   ` Dan Nelson [this message]
1998-10-29 14:16 ` Alain Caron

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=19981029121953.A7145@emsphone.com \
    --to=dnelson@emsphone.com \
    --cc=pumilia@est.it \
    --cc=zefram@tao.co.uk \
    --cc=zsh-users@math.gatech.edu \
    /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).