zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@cambridgesiliconradio.com>
To: Rob Egelink <rob@rambo.its.tudelft.nl>,
	zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: jobs command in precmd
Date: Wed, 28 Jun 2000 11:20:38 +0100	[thread overview]
Message-ID: <0FWV001LZ0QDKS@la-la.cambridgesiliconradio.com> (raw)
In-Reply-To: "Your message of Wed, 28 Jun 2000 11:36:11 +0200." <20000628113611.A20108@rambo.its.tudelft.nl>

> Hello *,
> 
> When I put the 'jobs' builtin command in my precmd function, zsh
> exits immediately without giving me a warning that I still have
> background jobs.
> 
> I found out that zsh exits without a warning if the previous command
> was the jobs command.
> 
> But in my precmd function there are many commands after the jobs
> command.

The shell has a flag (which happens to be called stopmsg) to tell it that
you've just looked at your jobs, and hence don't need to be warned again.
The main use of this is that you need to be able to ignore the `you have
XXX jobs' messages, otherwise you couldn't leave the shell at all.
However, it's assumed that the `jobs' command also tells you all you need
to know, so you can exit straight after.  (You probably know all this.)

The real difficulty is that the stopmsg is only reset when the shell gets
back to the main command loop, i.e. after executing some block of
commands on a single line.  Arguably this is correct as far as it goes,
since it doesn't matter how you see the message from `jobs' --- for
example, you might have buried it inside your own shell function.  But the
case of precmd is a bit special, since effectively it all happens without
your knowing.  Maybe simply saving and restoring stopmsg when executing
precmd would be enough.  I don't have time to go into the details right
now, however.


       reply	other threads:[~2000-06-28 10:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20000628113611.A20108@rambo.its.tudelft.nl>
2000-06-28 10:20 ` Peter Stephenson [this message]
2000-06-29  9:25   ` PATCH: " Peter Stephenson
2000-06-29  9:41     ` Peter Stephenson

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=0FWV001LZ0QDKS@la-la.cambridgesiliconradio.com \
    --to=pws@cambridgesiliconradio.com \
    --cc=rob@rambo.its.tudelft.nl \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).