diff options
| author | dana <dana@dana.is> | 2026-05-20 13:48:41 -0500 |
|---|---|---|
| committer | dana <dana@dana.is> | 2026-05-23 00:26:42 -0500 |
| commit | 8284a42bd3d0b7333f8d3c59cd6bb860c0edf499 (patch) | |
| tree | d8ba25aea3fbdd6638b6153c10aa72da6b87f9e2 /Test/W02jobs.ztst | |
| parent | unposted: NEWS: update for w/52326 and w/52594 (diff) | |
| download | zsh-8284a42bd3d0b7333f8d3c59cd6bb860c0edf499.tar zsh-8284a42bd3d0b7333f8d3c59cd6bb860c0edf499.tar.gz zsh-8284a42bd3d0b7333f8d3c59cd6bb860c0edf499.tar.bz2 zsh-8284a42bd3d0b7333f8d3c59cd6bb860c0edf499.tar.lz zsh-8284a42bd3d0b7333f8d3c59cd6bb860c0edf499.tar.xz zsh-8284a42bd3d0b7333f8d3c59cd6bb860c0edf499.tar.zst zsh-8284a42bd3d0b7333f8d3c59cd6bb860c0edf499.zip | |
54584: jobs: update curjob in sub-shells
Diffstat (limited to 'Test/W02jobs.ztst')
| -rw-r--r-- | Test/W02jobs.ztst | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/Test/W02jobs.ztst b/Test/W02jobs.ztst index d52888dd9..135869d81 100644 --- a/Test/W02jobs.ztst +++ b/Test/W02jobs.ztst @@ -193,6 +193,104 @@ *>\[2] ? interrupt*sleep* *>\[1] ? kill*sleep* + zpty_start + zpty_input jobs + zpty_input '( jobs ); :' + zpty_stop +0:jobs with no jobs + + zpty_start + zpty_input 'sleep 2 &; ( jobs ); disown' + zpty_stop +0:jobs in sub-shell with job in parent shell +*>\[1] <-> +*>\[1] + * sleep 2 + + zpty_start + zpty_input '( sleep 2 &; jobs ); :' + zpty_stop +0:jobs in sub-shell with job in same shell +*>\[2] + * sleep 2 + + zpty_start + zpty_input 'sleep 2 &; jobs; ( sleep 3 &; jobs ); jobs; disown' + zpty_stop +0:jobs in sub-shell with job in parent + same shell +*>\[1] <-> +*>\[1] + * sleep 2 +*>\[2] + * sleep 3 +*>\[1] + * sleep 2 + + zpty_start + zpty_input '( sleep 2 &; sleep 3 &; jobs ); :' + zpty_stop +0:jobs in sub-shell with two jobs in same shell +*>\[2] - * sleep 2 +*>\[3] + * sleep 3 + + zpty_start + zpty_input 'sleep 2 &; sleep 3 &; disown; jobs; disown' + zpty_stop +0:disown current job +*>\[1] <-> +*>\[2] <-> +*>\[1] + * sleep 2 + + zpty_start + zpty_input disown + zpty_stop +0:disown with no jobs +>disown: no current job + + zpty_start + zpty_input 'sleep 2 &; ( disown ); jobs; disown' + zpty_stop +0:disown in sub-shell with job in parent shell +*>\[1] <-> +*>disown: can't manipulate jobs in subshell +*>\[1] + * sleep 2 + + zpty_start + zpty_input '( sleep 3 &; disown; jobs ); :' + zpty_stop +0:disown in sub-shell with job in same shell + + zpty_start + zpty_input 'sleep 2 &; ( sleep 3 &; disown; jobs ); jobs; disown' + zpty_stop +0:disown in sub-shell with job in parent + same shell +*>\[1] <-> +*>\[1] + * sleep 2 + +# @todo apparently testing suspended jobs with zpty is error-prone. see above +# zpty_start +# zpty_input 'sleep 3 &' +# zpty_input 'kill -STOP ${${=${ jobs -p }}[3]}' +# zpty_input 'disown' +# zpty_stop +#0:disown with stopped job +#*>\[1] <-> +#*>\[1] * suspended * sleep 3 +#*>disown: warning: job is suspended* + + zpty_start + zpty_input 'sleep 2 &; sleep 3 &|; jobs; disown' + zpty_input 'sleep 2 &; sleep 3 &!; jobs; disown' + zpty_stop +0:background and disown with &| and &! +*>\[1] <-> +*>\[1] * sleep 2 +*>\[1] <-> +*>\[1] * sleep 2 + + zpty_start + zpty_input '( fg ); :' + zpty_input '( bg ); :' + zpty_stop +0:fg + bg in sub-shell +*>fg: no job control in this shell +*>bg: no job control in this shell + %clean zmodload -ui zsh/zpty |
