zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: empty job texts for suspended .zshrc jobs
Date: Tue, 04 Apr 2017 10:30:27 +0100	[thread overview]
Message-ID: <20170404103027.3d0f1928@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <170330143636.ZM17242@torch.brasslantern.com>

On Thu, 30 Mar 2017 14:36:36 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Mar 27, 11:20am, Stephane Chazelas wrote:
> }
> } zsh: suspended   |
> 
> Hm, this is because what you've actually suspended is the "source"
> command; the pipeline is the foreground job of the script file that
> "source" is reading.  It's just that "source" doesn't get a slot
> in the job table because semantically it's masquerading as the top
> level shell.

Urm...

Presumably the assumption here was a sourced file wouldn't need the job
text, which presumably is wrong so this fix is reasonable...?

pws

diff --git a/Src/exec.c b/Src/exec.c
index 137130e..f021a08 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1859,7 +1859,7 @@ execpline2(Estate state, wordcode pcode,
 	lineno = WC_PIPE_LINENO(pcode) - 1;
 
     if (pline_level == 1) {
-	if ((how & Z_ASYNC) || (!sfcontext && !sourcelevel))
+	if ((how & Z_ASYNC) || !sfcontext)
 	    strcpy(list_pipe_text,
 		   getjobtext(state->prog,
 			      state->pc + (WC_PIPE_TYPE(pcode) == WC_PIPE_END ?
@@ -3090,7 +3090,7 @@ execcmd_exec(Estate state, Execcmd_params eparams,
 
     /* Get the text associated with this command. */
     if ((how & Z_ASYNC) ||
-	(!sfcontext && !sourcelevel && (jobbing || (how & Z_TIMED))))
+	(!sfcontext && (jobbing || (how & Z_TIMED))))
 	text = getjobtext(state->prog, eparams->beg);
     else
 	text = NULL;


  reply	other threads:[~2017-04-04  9:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 10:20 Stephane Chazelas
2017-03-30 21:36 ` Bart Schaefer
2017-04-04  9:30   ` Peter Stephenson [this message]
2017-04-04 22:44     ` Bart Schaefer

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=20170404103027.3d0f1928@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@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).