From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3857 invoked from network); 3 Mar 2022 22:05:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Mar 2022 22:05:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1646345115; b=jpepMFa2NF+25sA4YVzmM7Bm+D14dMkD7KDW+Q3+46I4hTRMNPoKVnyX57Ib4vSRjo2IdHQpj+ Rk5FKwK/Jp2tUi4tFkI5qythfODsk7Ui3vCVMKY6OHp/uKiCNwNh0lMuMNRzcLqeu2YjycEZX0 YjzUTSbz/P03dRMIN8BYH5dLJZ1F8pfG+L8tDKJ243fzzjRc9QWV+OPuJ74fL5NXY9plItvZb4 b/oi1vxB31dY6LfbfNbRnhBz8Fx2zTThacOXhL5Zf9WNUwT/tZV05Rz4GfUFSrG/4PMnA6pO3A aAbqEySsZ3aObARlmP5tvzaIRYlO7NIKY1hldTCNFZ2D3g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f54.google.com) smtp.remote-ip=209.85.167.54; dmarc=none header.from=alumni.princeton.edu; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1646345115; bh=rZivpcKSfBmezNlD5CclOp+4e0Uuo1xEB4OKSfw0Q6M=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature; b=QZeXmAMFzFv/4loCJP7eZUpNwN4erVlEvKCl8RkoxzSP0NkVp6FqYJUXUoFHLz6AkamKIX4yxm PyROWWYBnG+31DCkk9aAfe/OSbPAjC8zOZG8RdEe/dIIwVfwMlGXY1iGCE9oKAFlD3LTjfhg/L dGQPBsMubsc+smrro8aTIjLv5xTIWc/UNLbIH8MLNB1/4fg+cVgR8zxmxkyw0mKNBVkKVhKpyy 2kqr4NpR50FEx1ppYiENU/v3HUI2nchmDhs05RoOMoRhz7JoqlwxzSuS7LVmIV3xb1ZyTn9OE0 dZFegq3ty3HAjbWpsQExUtPxuTruiyUIG77uyAEHgxS9Mw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=x/sToG0/c7RsRVH/S+yMHhQroKBnFnLC/qPo9RJbHro=; b=fKfD95/v8BQNKU6dpaf3iHITnY 2ZiUwuHNjkTr5/PuNAaIcruF4Wy6X1EhCOv048SqAT1O3bwKPm9vtj6WJ0rAyHlOMVeTluD4q1eRX Tfj/sTshLc8C3RwBiaPCrPl7J5SNjH8DXUQV+QcLIuv9DOeafrFpAt//kw6NPDJ2kCViwJsoURJrW jQiCGeIKW6gdVeyvRQUpTYKjhL4SJpB9CelgOVFPZA8x0NvIp4tuN4seO/Corq5sq1t7NUZw+FPWg us8wELoPdFVltT7QI/HyERA9ohz5DFbwHxSLIthVly9TbrMoceWnGMzYJPu3fVKJFLIOscYhNP8Ju MColn+9A==; Received: from authenticated user by zero.zsh.org with local id 1nPtZT-000LsJ-Ew; Thu, 03 Mar 2022 22:05:15 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f54.google.com) smtp.remote-ip=209.85.167.54; dmarc=none header.from=alumni.princeton.edu; arc=none Received: from mail-lf1-f54.google.com ([209.85.167.54]:44020) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nPtZC-000LWz-9M; Thu, 03 Mar 2022 22:04:59 +0000 Received: by mail-lf1-f54.google.com with SMTP id g39so10872708lfv.10 for ; Thu, 03 Mar 2022 14:04:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x/sToG0/c7RsRVH/S+yMHhQroKBnFnLC/qPo9RJbHro=; b=B0CO4sXfQ+lQNyeWIrecj3ALxPAiwanmstFpt7k1dUMKRHpG4HRgl6/ELslzhHIoxs StL83ThWuyYgDkvcwmiEXT+MML38cBqzrTcFNRSV+Fb2JWx9QTwvnAEdsvVS/PFBp+C5 32KEL17/jEUFqS9g9aW55FrWYaKotUF1XIFSp6IlQI09p4buwDF+uh9Bu9/X9qpv5Ptb 7Yr6QxVilIkZ2kq25gGE79trnLU4+2gXoVkK9/wGRjtQ8v5np5bAS36IWyG270wbfkAn uuz9l0imwATOUV8wxpda6cqJSKQDaPguiry/Ltf000K+OrkLE/eEJDHn8bvP98cvOLl8 MCJA== X-Gm-Message-State: AOAM530IGGeXQ4jZAvz5zQHEJ8+qK158DO5eFnVMYp6UMZmoQX2ymYbA uRF7eVZ7trr/00BTAeyY6PJ2TrJz2vSfKeh124S9PdWjiEe3Mg== X-Google-Smtp-Source: ABdhPJzTaAiqD20N5PgTT9KgAKnHmMGAPWPsZzkWcBW4/faur6Wlla2ggTcFro8CfrNJFQWOHeupYXd2bHSJFVIlb/A= X-Received: by 2002:a19:6456:0:b0:437:974a:f5ce with SMTP id b22-20020a196456000000b00437974af5cemr22531521lfj.394.1646345097127; Thu, 03 Mar 2022 14:04:57 -0800 (PST) MIME-Version: 1.0 References: <1912988517.1110378.1646131250968@mail2.virginmedia.com> <18fc86e5-467d-4753-9f82-6a3073874334@www.fastmail.com> In-Reply-To: From: Vin Shelton Date: Thu, 3 Mar 2022 17:04:20 -0500 Message-ID: Subject: Re: [Bug] $jobstates does not work in $() To: Peter Stephenson Cc: zsh-workers Content-Type: multipart/alternative; boundary="000000000000b12c6b05d9579662" X-Seq: 49794 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --000000000000b12c6b05d9579662 Content-Type: text/plain; charset="UTF-8" I don't see how you could have provoked this, Peter, but in the latest sources, I'm seeing a test failure under i3 in Arch: ZTST_verbose=2 make TESTNUM=W03 check cd Test ; make check make[1]: Entering directory '/opt/build/zsh-2022-03-03/Test' if test -n "gcc"; then \ cd .. && DESTDIR= \ make MODDIR=`pwd`/Test/Modules install.modules > /dev/null; \ fi if test -z "$ZTST_handler"; then \ ZTST_handler=runtests.zsh; \ fi; \ if ZTST_testlist="`for f in ../../../src/zsh-2022-03-03/Test/W03*.ztst; \ do echo $f; done`" \ ZTST_srcdir="../../../src/zsh-2022-03-03/Test" \ ZTST_exe=../Src/zsh \ ../Src/zsh +Z -f ../../../src/zsh-2022-03-03/Test/$ZTST_handler; then \ stat=0; \ else \ stat=1; \ fi; \ sleep 1; \ rm -rf Modules .zcompdump; \ exit $stat ../../../src/zsh-2022-03-03/Test/W03jobparameters.ztst: starting. ZTST_getsect: read section name: prep ZTST_getchunk: read code chunk: if zmodload zsh/zpty 2> /dev/null; then zpty_start() { export PS1= PS2= zpty -d zpty zsh "${(q)ZTST_testdir}/../Src/zsh -fiV +Z" } zpty_input() { zpty -w zsh "${(F)@}" $'\n' } zpty_line() { local REPLY integer i for (( i = 0; i < ${1:-1}; ++i )); do zpty -r zsh REPLY print -r -- ${REPLY%%($'\r\n'|$'\n')} done } zpty_stop() { # exit twice in case of check_jobs zpty -w zsh $'exit\nexit\n' # zpty gives no output when piped without these braces (?) { zpty -r zsh } | sed $'/[^[:space:]]/!d; s/\r$//;' zpty -d : } if ! zmodload zsh/parameter 2> /dev/null; then ZTST_unimplemented='the zsh/parameter module is not available' fi else ZTST_unimplemented='the zsh/zpty module is not available' fi ZTST_execchunk: status 0 ZTST_getchunk: read code chunk: ZTST_getsect: read section name: test ZTST_test: looking for new test ZTST_test: examining line: ZTST_test: examining line: zpty_start ZTST_getchunk: read code chunk: zpty_start zpty_input 'sleep 3 &' zpty_input 'print $jobstates' zpty_input '(print $jobstates)' zpty_input 'jobs -s' zpty_stop ZTST_test: examining line: *>\[1] [0-9]## ZTST_getredir: read redir for '>': \[1] [0-9]## ZTST_test: examining line: *>running:+:*=running ZTST_getredir: read redir for '>': running:+:*=running ZTST_test: examining line: *>running:+:*=running ZTST_getredir: read redir for '>': running:+:*=running ZTST_test: examining line: *>zsh:*SIGHUPed* ZTST_getredir: read redir for '>': zsh:*SIGHUPed* ZTST_test: examining line: Running test: $jobstate for running job in main shell and subshell ZTST_test: expecting status: 0 Input: /tmp/zsh.ztst.46005/ztst.in, output: /tmp/zsh.ztst.46005/ztst.out, error: /tmp/zsh.ztst.46005/ztst.terr ZTST_execchunk: status 0 ZTST_test: test produced standard output: [1] 46016 zsh: failed to load module `zsh/parameter': /opt/zsh-2022-03-03/lib/zsh/5.8.1.1-dev/zsh/parameter.so: cannot open shared object file: No such file or directory zsh/parameter zsh: failed to load module `zsh/parameter': /opt/zsh-2022-03-03/lib/zsh/5.8.1.1-dev/zsh/parameter.so: cannot open shared object file: No such file or directory zsh/parameter zsh: warning: 1 jobs SIGHUPed ZTST_test: and standard error: Pattern match failed, line mismatch (4/6): <\[1] [0-9]## [1] 46016 >zsh: failed to load module `zsh/parameter': /opt/zsh-2022-03-03/lib/zsh/5.8.1.1-dev/zsh/parameter.so: cannot open shared object file: No such file or directory >zsh/parameter >zsh: failed to load module `zsh/parameter': /opt/zsh-2022-03-03/lib/zsh/5.8.1.1-dev/zsh/parameter.so: cannot open shared object file: No such file or directory >zsh/parameter >zsh: warning: 1 jobs SIGHUPed Test ../../../src/zsh-2022-03-03/Test/W03jobparameters.ztst failed: output differs from expected as shown above for: zpty_start zpty_input 'sleep 3 &' zpty_input 'print $jobstates' zpty_input '(print $jobstates)' zpty_input 'jobs -s' zpty_stop Was testing: $jobstate for running job in main shell and subshell ../../../src/zsh-2022-03-03/Test/W03jobparameters.ztst: test failed. ************************************** 0 successful test scripts, 1 failure, 0 skipped ************************************** make[1]: *** [Makefile:190: check] Error 1 make[1]: Leaving directory '/opt/build/zsh-2022-03-03/Test' make: *** [Makefile:263: check] Error 2 TIA, Vin On Wed, Mar 2, 2022 at 3:19 PM Peter Stephenson wrote: > On Wed, 2022-03-02 at 09:44 +0000, Daniel Shahaf wrote: > > Peter Stephenson wrote on Tue, 01 Mar 2022 10:40 +00:00: > > Is this testable? Sorry, haven't got time to write a test myself right > now. > > We could do something like this. > > pws > > diff --git a/Test/W02jobs.ztst b/Test/W02jobs.ztst > index b09f2ac62..d52888dd9 100644 > --- a/Test/W02jobs.ztst > +++ b/Test/W02jobs.ztst > @@ -144,12 +144,14 @@ > zpty_start > zpty_input 'sleep 3 &' > zpty_input 'jobs -r' > + zpty_input '(jobs -r)' > zpty_input 'print -- -' > zpty_input 'jobs -s' > zpty_stop > 0:`jobs -r` and `jobs -s` with running job > *>\[1] [0-9]## > *>\[1] + running*sleep* > +*>\[1] + running*sleep* > *>- > *>zsh:*SIGHUPed* > > diff --git a/Test/W03jobparameters.ztst b/Test/W03jobparameters.ztst > new file mode 100644 > index 000000000..474adfaec > --- /dev/null > +++ b/Test/W03jobparameters.ztst > @@ -0,0 +1,49 @@ > +# Tests for interactive job control with parameter state > + > +%prep > + > + if zmodload zsh/zpty 2> /dev/null; then > + zpty_start() { > + export PS1= PS2= > + zpty -d > + zpty zsh "${(q)ZTST_testdir}/../Src/zsh -fiV +Z" > + } > + zpty_input() { > + zpty -w zsh "${(F)@}" $'\n' > + } > + zpty_line() { > + local REPLY > + integer i > + for (( i = 0; i < ${1:-1}; ++i )); do > + zpty -r zsh REPLY > + print -r -- ${REPLY%%($'\r\n'|$'\n')} > + done > + } > + zpty_stop() { > + # exit twice in case of check_jobs > + zpty -w zsh $'exit\nexit\n' > + # zpty gives no output when piped without these braces (?) > + { zpty -r zsh } | sed $'/[^[:space:]]/!d; s/\r$//;' > + zpty -d > + : > + } > + if ! zmodload zsh/parameter 2> /dev/null; then > + ZTST_unimplemented='the zsh/parameter module is not available' > + fi > + else > + ZTST_unimplemented='the zsh/zpty module is not available' > + fi > + > +%test > + > + zpty_start > + zpty_input 'sleep 3 &' > + zpty_input 'print $jobstates' > + zpty_input '(print $jobstates)' > + zpty_input 'jobs -s' > + zpty_stop > +0:$jobstate for running job in main shell and subshell > +*>\[1] [0-9]## > +*>running:+:*=running > +*>running:+:*=running > +*>zsh:*SIGHUPed* > > > --000000000000b12c6b05d9579662 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I don't see how you could have provoked = this, Peter, but in the latest sources, I'm seeing a test failure under= i3 in Arch:

ZTST_verbose=3D2 ma= ke TESTNUM=3DW03 check
cd Test ; make check
make[1]: Entering directo= ry '/opt/build/zsh-2022-03-03/Test'
if test -n "gcc"; = then \
=C2=A0 cd .. && DESTDIR=3D \
=C2=A0 make MODDIR=3D`pwd= `/Test/Modules install.modules > /dev/null; \
fi
if test -z "= $ZTST_handler"; then \
=C2=A0 ZTST_handler=3Druntests.zsh; \
fi;= \
if ZTST_testlist=3D"`for f in ../../../src/zsh-2022-03-03/Test/W= 03*.ztst; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0do echo $f; done`&q= uot; \
=C2=A0ZTST_srcdir=3D"../../../src/zsh-2022-03-03/Test" = \
=C2=A0ZTST_exe=3D../Src/zsh \
=C2=A0../Src/zsh +Z -f ../../../src/z= sh-2022-03-03/Test/$ZTST_handler; then \
=C2=A0stat=3D0; \
else \
= =C2=A0stat=3D1; \
fi; \
sleep 1; \
rm -rf Modules .zcompdump; \exit $stat
../../../src/zsh-2022-03-03/Test/W03jobparameters.ztst: star= ting.
ZTST_getsect: read section name: prep
ZTST_getchunk: read code = chunk:
=C2=A0 if zmodload zsh/zpty 2> /dev/null; then
=C2=A0 =C2= =A0 zpty_start() {
=C2=A0 =C2=A0 =C2=A0 export PS1=3D PS2=3D
=C2=A0 = =C2=A0 =C2=A0 zpty -d
=C2=A0 =C2=A0 =C2=A0 zpty zsh "${(q)ZTST_test= dir}/../Src/zsh -fiV +Z"
=C2=A0 =C2=A0 }
=C2=A0 =C2=A0 zpty_inpu= t() {
=C2=A0 =C2=A0 =C2=A0 zpty -w zsh "${(F)@}" $'\n'=
=C2=A0 =C2=A0 }
=C2=A0 =C2=A0 zpty_line() {
=C2=A0 =C2=A0 =C2=A0 = local REPLY
=C2=A0 =C2=A0 =C2=A0 integer i
=C2=A0 =C2=A0 =C2=A0 for (= ( i =3D 0; i < ${1:-1}; ++i )); do
=C2=A0 =C2=A0 =C2=A0 =C2=A0 zpty -= r zsh REPLY
=C2=A0 =C2=A0 =C2=A0 =C2=A0 print -r -- ${REPLY%%($'\r\n= '|$'\n')}
=C2=A0 =C2=A0 =C2=A0 done
=C2=A0 =C2=A0 }
= =C2=A0 =C2=A0 zpty_stop() {
=C2=A0 =C2=A0 =C2=A0 # exit twice in case of= check_jobs
=C2=A0 =C2=A0 =C2=A0 zpty -w zsh $'exit\nexit\n'
= =C2=A0 =C2=A0 =C2=A0 # zpty gives no output when piped without these braces= (?)
=C2=A0 =C2=A0 =C2=A0 { zpty -r zsh } | sed $'/[^[:space:]]/!d; = s/\r$//;'
=C2=A0 =C2=A0 =C2=A0 zpty -d
=C2=A0 =C2=A0 =C2=A0 :
= =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 if ! zmodload zsh/parameter 2> /dev/nul= l; then
=C2=A0 =C2=A0 =C2=A0 ZTST_unimplemented=3D'the zsh/parameter= module is not available'
=C2=A0 =C2=A0 fi
=C2=A0 else
=C2=A0 = =C2=A0 ZTST_unimplemented=3D'the zsh/zpty module is not available'<= br>=C2=A0 fi
ZTST_execchunk: status 0
ZTST_getchunk: read code chunk:=

ZTST_getsect: read section name: test
ZTST_test: looking for new= test
ZTST_test: examining line:

ZTST_test: examining line:
= =C2=A0 zpty_start
ZTST_getchunk: read code chunk:
=C2=A0 zpty_start=C2=A0 zpty_input 'sleep 3 &'
=C2=A0 zpty_input 'print= $jobstates'
=C2=A0 zpty_input '(print $jobstates)'
=C2= =A0 zpty_input 'jobs -s'
=C2=A0 zpty_stop
ZTST_test: examinin= g line:
*>\[1] [0-9]##
ZTST_getredir: read redir for '>'= ;:
\[1] [0-9]##
ZTST_test: examining line:
*>running:+:*=3Drunn= ing
ZTST_getredir: read redir for '>':
running:+:*=3Drunni= ng
ZTST_test: examining line:
*>running:+:*=3Drunning
ZTST_getr= edir: read redir for '>':
running:+:*=3Drunning
ZTST_test:= examining line:
*>zsh:*SIGHUPed*
ZTST_getredir: read redir for &#= 39;>':
zsh:*SIGHUPed*
ZTST_test: examining line:

Runnin= g test: $jobstate for running job in main shell and subshell
ZTST_test: = expecting status: 0
Input: /tmp/zsh.ztst.46005/ztst.in, output: /tmp/zsh.ztst.46005/ztst.out, error: /tmp/zsh.ztst.4= 6005/ztst.terr
ZTST_execchunk: status 0
ZTST_test: test produced stan= dard output:
[1] 46016
zsh: failed to load module `zsh/parameter'= : /opt/zsh-2022-03-03/lib/zsh/5.8.1.1-dev/zsh/parameter.so: cannot open sha= red object file: No such file or directory
zsh/parameter
zsh: failed = to load module `zsh/parameter': /opt/zsh-2022-03-03/lib/zsh/5.8.1.1-dev= /zsh/parameter.so: cannot open shared object file: No such file or director= y
zsh/parameter
zsh: warning: 1 jobs SIGHUPed
ZTST_test: and stand= ard error:

Pattern match failed, line mismatch (4/6):
=C2=A0<\= [1] [0-9]##
=C2=A0<running:+:*=3Drunning
=C2=A0<running:+:*=3Dr= unning
=C2=A0<zsh:*SIGHUPed*
=C2=A0>[1] 46016
=C2=A0>zsh:= failed to load module `zsh/parameter': /opt/zsh-2022-03-03/lib/zsh/5.8= .1.1-dev/zsh/parameter.so: cannot open shared object file: No such file or = directory
=C2=A0>zsh/parameter
=C2=A0>zsh: failed to load modul= e `zsh/parameter': /opt/zsh-2022-03-03/lib/zsh/5.8.1.1-dev/zsh/paramete= r.so: cannot open shared object file: No such file or directory
=C2=A0&g= t;zsh/parameter
=C2=A0>zsh: warning: 1 jobs SIGHUPed
Test ../../..= /src/zsh-2022-03-03/Test/W03jobparameters.ztst failed: output differs from = expected as shown above for:
=C2=A0 zpty_start
=C2=A0 zpty_input '= ;sleep 3 &'
=C2=A0 zpty_input 'print $jobstates'
=C2= =A0 zpty_input '(print $jobstates)'
=C2=A0 zpty_input 'jobs = -s'
=C2=A0 zpty_stop
Was testing: $jobstate for running job in ma= in shell and subshell
../../../src/zsh-2022-03-03/Test/W03jobparameters.= ztst: test failed.
**************************************
0 successfu= l test scripts, 1 failure, 0 skipped
***********************************= ***
make[1]: *** [Makefile:190: check] Error 1
make[1]: Leaving direc= tory '/opt/build/zsh-2022-03-03/Test'
make: *** [Makefile:263: c= heck] Error 2

TIA,
=C2=A0 Vin

On Wed, Mar 2, 2022 at 3:19 PM Peter Stephens= on <p.w.stephenson@ntlwor= ld.com> wrote:
On Wed, 2022-03-02 at 09:44 +0000, Daniel Shahaf wrote:
> Peter Stephenson wrote on Tue, 01 Mar 2022 10:40 +00:00:
> Is this testable?=C2=A0 Sorry, haven't got time to write a test my= self right now.

We could do something like this.

pws

diff --git a/Test/W02jobs.ztst b/Test/W02jobs.ztst
index b09f2ac62..d52888dd9 100644
--- a/Test/W02jobs.ztst
+++ b/Test/W02jobs.ztst
@@ -144,12 +144,14 @@
=C2=A0 =C2=A0zpty_start
=C2=A0 =C2=A0zpty_input 'sleep 3 &'
=C2=A0 =C2=A0zpty_input 'jobs -r'
+=C2=A0 zpty_input '(jobs -r)'
=C2=A0 =C2=A0zpty_input 'print -- -'
=C2=A0 =C2=A0zpty_input 'jobs -s'
=C2=A0 =C2=A0zpty_stop
=C2=A00:`jobs -r` and `jobs -s` with running job
=C2=A0*>\[1] [0-9]##
=C2=A0*>\[1]=C2=A0 + running*sleep*
+*>\[1]=C2=A0 + running*sleep*
=C2=A0*>-
=C2=A0*>zsh:*SIGHUPed*

diff --git a/Test/W03jobparameters.ztst b/Test/W03jobparameters.ztst
new file mode 100644
index 000000000..474adfaec
--- /dev/null
+++ b/Test/W03jobparameters.ztst
@@ -0,0 +1,49 @@
+# Tests for interactive job control with parameter state
+
+%prep
+
+=C2=A0 if zmodload zsh/zpty 2> /dev/null; then
+=C2=A0 =C2=A0 zpty_start() {
+=C2=A0 =C2=A0 =C2=A0 export PS1=3D PS2=3D
+=C2=A0 =C2=A0 =C2=A0 zpty -d
+=C2=A0 =C2=A0 =C2=A0 zpty zsh "${(q)ZTST_testdir}/../Src/zsh -fiV +Z&= quot;
+=C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 zpty_input() {
+=C2=A0 =C2=A0 =C2=A0 zpty -w zsh "${(F)@}" $'\n'
+=C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 zpty_line() {
+=C2=A0 =C2=A0 =C2=A0 local REPLY
+=C2=A0 =C2=A0 =C2=A0 integer i
+=C2=A0 =C2=A0 =C2=A0 for (( i =3D 0; i < ${1:-1}; ++i )); do
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 zpty -r zsh REPLY
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 print -r -- ${REPLY%%($'\r\n'|$'\n= ')}
+=C2=A0 =C2=A0 =C2=A0 done
+=C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 zpty_stop() {
+=C2=A0 =C2=A0 =C2=A0 # exit twice in case of check_jobs
+=C2=A0 =C2=A0 =C2=A0 zpty -w zsh $'exit\nexit\n'
+=C2=A0 =C2=A0 =C2=A0 # zpty gives no output when piped without these brace= s (?)
+=C2=A0 =C2=A0 =C2=A0 { zpty -r zsh } | sed $'/[^[:space:]]/!d; s/\r$//= ;'
+=C2=A0 =C2=A0 =C2=A0 zpty -d
+=C2=A0 =C2=A0 =C2=A0 :
+=C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 if ! zmodload zsh/parameter 2> /dev/null; then
+=C2=A0 =C2=A0 =C2=A0 ZTST_unimplemented=3D'the zsh/parameter module is= not available'
+=C2=A0 =C2=A0 fi
+=C2=A0 else
+=C2=A0 =C2=A0 ZTST_unimplemented=3D'the zsh/zpty module is not availab= le'
+=C2=A0 fi
+
+%test
+
+=C2=A0 zpty_start
+=C2=A0 zpty_input 'sleep 3 &'
+=C2=A0 zpty_input 'print $jobstates'
+=C2=A0 zpty_input '(print $jobstates)'
+=C2=A0 zpty_input 'jobs -s'
+=C2=A0 zpty_stop
+0:$jobstate for running job in main shell and subshell
+*>\[1] [0-9]##
+*>running:+:*=3Drunning
+*>running:+:*=3Drunning
+*>zsh:*SIGHUPed*


--000000000000b12c6b05d9579662--