zsh-workers
 help / color / mirror / code / Atom feed
* can't set tty pgrp
@ 2018-04-19 10:57 ` Vin Shelton
  2018-04-19 11:33   ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Vin Shelton @ 2018-04-19 10:57 UTC (permalink / raw)
  To: Zsh Hackers' List

[-- Attachment #1: Type: text/plain, Size: 250 bytes --]

The process group changes seem to have broken something:


: ~ Thu 19 6:52; vi
^Z
zsh: suspended  vi
: ~ Thu 19 6:52; fg
[1]  + continued  vi
zsh: can't set tty pgrp: no such process


This is built from the latest sources, on debian.

Thanks,
  Vin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: can't set tty pgrp
  2018-04-19 10:57 ` can't set tty pgrp Vin Shelton
@ 2018-04-19 11:33   ` Peter Stephenson
  2018-04-19 13:51     ` Vin Shelton
  2018-04-19 14:33     ` Bart Schaefer
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Stephenson @ 2018-04-19 11:33 UTC (permalink / raw)
  To: Vin Shelton, Zsh Hackers' List

On Thu, 19 Apr 2018 06:57:40 -0400
Vin Shelton <acs@alumni.princeton.edu> wrote:
> The process group changes seem to have broken something:
> 
> 
> : ~ Thu 19 6:52; vi
> ^Z
> zsh: suspended  vi
> : ~ Thu 19 6:52; fg
> [1]  + continued  vi
> zsh: can't set tty pgrp: no such process

Yep, I remember thinking about this and forgetting to do anything...

The following looks like it ought to be safe.

diff --git a/Src/signals.c b/Src/signals.c
index 2a6aa3f..6e12158 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -537,7 +537,8 @@ wait_for_processes(void)
 #else
 		update_process(pn, status);
 #endif
-		if (pn->pid == jn->gleader) {
+		if (WIFEXITED(status) &&
+		    pn->pid == jn->gleader) {
 		    jn->gleader = 0;
 		    if (!(jn->stat & STAT_NOSTTY)) {
 			/*


pws


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: can't set tty pgrp
  2018-04-19 11:33   ` Peter Stephenson
@ 2018-04-19 13:51     ` Vin Shelton
  2018-04-19 14:06       ` Peter Stephenson
  2018-04-19 14:33     ` Bart Schaefer
  1 sibling, 1 reply; 6+ messages in thread
From: Vin Shelton @ 2018-04-19 13:51 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh Hackers' List

[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]

Seems to work.  Thanks.  I think this is serious enough to merit a 5.5.2
release.  Thoughts?

  - Vin

On Thu, Apr 19, 2018 at 7:33 AM, Peter Stephenson <p.stephenson@samsung.com>
wrote:

> On Thu, 19 Apr 2018 06:57:40 -0400
> Vin Shelton <acs@alumni.princeton.edu> wrote:
> > The process group changes seem to have broken something:
> >
> >
> > : ~ Thu 19 6:52; vi
> > ^Z
> > zsh: suspended  vi
> > : ~ Thu 19 6:52; fg
> > [1]  + continued  vi
> > zsh: can't set tty pgrp: no such process
>
> Yep, I remember thinking about this and forgetting to do anything...
>
> The following looks like it ought to be safe.
>
> diff --git a/Src/signals.c b/Src/signals.c
> index 2a6aa3f..6e12158 100644
> --- a/Src/signals.c
> +++ b/Src/signals.c
> @@ -537,7 +537,8 @@ wait_for_processes(void)
>  #else
>                 update_process(pn, status);
>  #endif
> -               if (pn->pid == jn->gleader) {
> +               if (WIFEXITED(status) &&
> +                   pn->pid == jn->gleader) {
>                     jn->gleader = 0;
>                     if (!(jn->stat & STAT_NOSTTY)) {
>                         /*
>
>
> pws
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: can't set tty pgrp
  2018-04-19 13:51     ` Vin Shelton
@ 2018-04-19 14:06       ` Peter Stephenson
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2018-04-19 14:06 UTC (permalink / raw)
  To: Zsh Hackers' List

On Thu, 19 Apr 2018 09:51:39 -0400
Vin Shelton <acs@alumni.princeton.edu> wrote:
> Seems to work.  Thanks.  I think this is serious enough to merit a
> 5.5.2 release.  Thoughts?

That change didn't go into 5.5.1; I applied it as soon as 5.5.1
was out of the way.

pws


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: can't set tty pgrp
  2018-04-19 11:33   ` Peter Stephenson
  2018-04-19 13:51     ` Vin Shelton
@ 2018-04-19 14:33     ` Bart Schaefer
  2018-04-19 15:29       ` Peter Stephenson
  1 sibling, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2018-04-19 14:33 UTC (permalink / raw)
  To: Zsh Hackers' List

On Thu, Apr 19, 2018 at 4:33 AM, Peter Stephenson
<p.stephenson@samsung.com> wrote:
> On Thu, 19 Apr 2018 06:57:40 -0400
> Vin Shelton <acs@alumni.princeton.edu> wrote:
>>
>> : ~ Thu 19 6:52; vi
>> ^Z
>> zsh: suspended  vi
>> : ~ Thu 19 6:52; fg
>> [1]  + continued  vi
>> zsh: can't set tty pgrp: no such process
>
> Yep, I remember thinking about this and forgetting to do anything...

Do we need a regression test for suspend+fg?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: can't set tty pgrp
  2018-04-19 14:33     ` Bart Schaefer
@ 2018-04-19 15:29       ` Peter Stephenson
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2018-04-19 15:29 UTC (permalink / raw)
  To: Zsh Hackers' List

On Thu, 19 Apr 2018 07:33:04 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Thu, Apr 19, 2018 at 4:33 AM, Peter Stephenson
> <p.stephenson@samsung.com> wrote:
> > On Thu, 19 Apr 2018 06:57:40 -0400
> > Vin Shelton <acs@alumni.princeton.edu> wrote:  
> >>
> >> : ~ Thu 19 6:52; vi
> >> ^Z
> >> zsh: suspended  vi
> >> : ~ Thu 19 6:52; fg
> >> [1]  + continued  vi
> >> zsh: can't set tty pgrp: no such process  
> >
> > Yep, I remember thinking about this and forgetting to do
> > anything...  
> 
> Do we need a regression test for suspend+fg?

I haven't looked at W02jobs.ztst in any great detail (I committed
it but didn't write it), but it looks like it would be very helpful
and we could do with adding a whole set of fg and bg tests.

pws


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-04-19 15:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20180419105813epcas5p4a20cf461f81c58b8a89ad6350c8c9942@epcas5p4.samsung.com>
2018-04-19 10:57 ` can't set tty pgrp Vin Shelton
2018-04-19 11:33   ` Peter Stephenson
2018-04-19 13:51     ` Vin Shelton
2018-04-19 14:06       ` Peter Stephenson
2018-04-19 14:33     ` Bart Schaefer
2018-04-19 15:29       ` Peter Stephenson

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).