From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7186 invoked by alias); 5 May 2015 19:02:34 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35037 Received: (qmail 18542 invoked from network); 5 May 2015 19:02:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=kbniDI/Jzn+8gGHakyPlT0x25hKrMw7v54NJ7yMC4i0=; b=CwYPeuVACsl7gM/PjVoAxSiynLCv+nWEjzEJTVl0BAJZsg9gLA1Z3Etdwk1A+qQGqX UxiN2FJqD0u5Qv1WeZ0zGFp7SND/boT+sSswIYAHOf4UDXwygFNIjv6N7l4GgqN3FH8i ADGxV2Ch5VnnjhEFrP9ilOkJ3xBFQHtwxW0QHGiFaoIjhxKtWph3/1x8pVf4hyoNV5F8 pMje4K789hsNJwJ/NjATbRANZmgxGcHuCvP4M/yw3oUHxKhpb1eb8KQD57lSWHVCu6tg j9SGQtGJmtw5uKXjg64RIPTlaqwfibmBp8Zyq21rVo6LCbHZqK3vY93Giu26IjzFucB9 QEFQ== X-Gm-Message-State: ALoCoQkl9AtvAqI2x3HEQ9ZYavsPs31Xh+eKY2Epd4UeB3L1YNr3uNEU4XUp08rz3P8doh8L2MSR X-Received: by 10.60.65.97 with SMTP id w1mr4906095oes.10.1430852538134; Tue, 05 May 2015 12:02:18 -0700 (PDT) From: Bart Schaefer Message-Id: <150505120214.ZM18560@torch.brasslantern.com> Date: Tue, 5 May 2015 12:02:14 -0700 In-Reply-To: <20150504183647.687c0c1e@ntlworld.com> Comments: In reply to Peter Stephenson "Re: jobs -r doesn't show jobs continued by kill -CONT" (May 4, 6:36pm) References: <20150503225212.GA2752@localhost.localdomain> <20150504183647.687c0c1e@ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: jobs -r doesn't show jobs continued by kill -CONT MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 4, 6:36pm, Peter Stephenson wrote: } Subject: Re: jobs -r doesn't show jobs continued by kill -CONT } } On Mon, 4 May 2015 06:52:13 +0800 } Han Pingtian wrote: } > jobs -r doesn't show a job which suspended the continued by kill -CONT: } } Not sure whether to use makerunning() here. It's handled per process } rather than per job at this point, so it's not entirely clear at what } point the STAT_STOPPED flag should be removed, either. Is there compound-command weirdness that's going to show up as a result of changing jn->stat along with pn->status if there is more than one process per job? torch% sleep 50 | sleep 51 | sleep 52 zsh: suspended sleep 50 | sleep 51 | sleep 52 torch% ps ax | grep sleep 18552 pts/3 T 0:00 sleep 50 18553 pts/3 T 0:00 sleep 51 18554 pts/3 T 0:00 sleep 52 18556 pts/3 S+ 0:00 grep sleep torch% kill -CONT 18553 torch% jobs [1] + suspended sleep 50 | running sleep 51 | suspended sleep 52 torch% jobs -s torch% jobs -r [1] + suspended sleep 50 | running sleep 51 | suspended sleep 52 torch% Is it really correct to treat that last one as "running" when two-thirds of it is still stopped? There's something else a bit odd here, but I don't know that it's fixable. torch% sleeper() { echo sleeping; sleep 50; echo done sleeping } torch% sleeper torch% sleeper sleeping zsh: suspended sleeper torch% jobs -l [1] + 18524 suspended sleeper torch% kill -CONT 18524 done sleeping torch% ps x | grep sleep 18523 pts/3 T 0:00 sleep 50 So the function resumed but its child remained stopped. On the other hand if I CONT the child sleep itself, the function remains "suspended" as far as the parent "jobs" can tell, but it wakes up and exits when it gets the CHLD from the actual sleep timing out. torch% sleeper sleeping zsh: suspended sleeper torch% jobs -l [1] + 18543 suspended sleeper torch% kill -CONT 18542 torch% ps ax | grep '1854[23]' 18542 pts/3 S 0:00 sleep 50 18543 pts/3 T 0:00 Src/zsh -f torch% done sleeping [1] + done sleeper torch% -- Barton E. Schaefer