zsh-workers
 help / color / mirror / code / Atom feed
* "You have running jobs" warning
@ 1996-06-01 17:52 Hrvoje Niksic
  1996-06-03 11:37 ` Zefram
  0 siblings, 1 reply; 10+ messages in thread
From: Hrvoje Niksic @ 1996-06-01 17:52 UTC (permalink / raw)
  To: zsh-workers

When I set NO_HUP, I would like the "you have running jobs" warning to
disappear when leaving zsh, since the option should make it look like
other shells in that respect (e.g. bash prints no warnings about
background running jobs).

Thus, if nohup is unset, the warning should be printed and the shell
should require pressing C-d twice to exit, HUP-ing the job before
exiting.

However, if nohup is set, there should be no warning about running
background jobs, and only one C-d should be sufficient to exit. This
little patch does this. Could you please include it to the
distribution, since the modified behaviour strikes me as much more
logical.

*** jobs.c.orig	Sat Jun  1 18:31:07 1996
--- jobs.c	Sat Jun  1 19:42:54 1996
***************
*** 846,855 ****
  #else
  	    zerr("you have stopped jobs.", NULL, 0);
  #endif
  
! 	} else
  	    zerr("you have running jobs.", NULL, 0);
! 	stopmsg = 1;
      }
  }
  
--- 846,857 ----
  #else
  	    zerr("you have stopped jobs.", NULL, 0);
  #endif
+ 	    stopmsg = 1;
  
! 	} else if (!isset(NOHUP)) {
  	    zerr("you have running jobs.", NULL, 0);
! 	    stopmsg = 1;
! 	}
      }
  }
  


-- 
hniksic@srce.hr              |  Student of electrical engineering
hniksic@fly.cc.fer.hr        |  University of Zagreb, Croatia
------------------------------------------------------------------
Signature strajka!



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

* Re: "You have running jobs" warning
  1996-06-01 17:52 "You have running jobs" warning Hrvoje Niksic
@ 1996-06-03 11:37 ` Zefram
  1996-06-03 13:18   ` Hrvoje Niksic
  0 siblings, 1 reply; 10+ messages in thread
From: Zefram @ 1996-06-03 11:37 UTC (permalink / raw)
  To: Hrvoje Niksic; +Cc: zsh-workers

>When I set NO_HUP, I would like the "you have running jobs" warning to
>disappear when leaving zsh, since the option should make it look like
>other shells in that respect (e.g. bash prints no warnings about
>background running jobs).

If you unset the MONITOR option, you won't get the warning.

-zefram



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

* Re: "You have running jobs" warning
  1996-06-03 11:37 ` Zefram
@ 1996-06-03 13:18   ` Hrvoje Niksic
  1996-06-03 13:37     ` Zefram
  0 siblings, 1 reply; 10+ messages in thread
From: Hrvoje Niksic @ 1996-06-03 13:18 UTC (permalink / raw)
  To: Zefram; +Cc: hniksic, zsh-workers

In your mail, you said:
> >When I set NO_HUP, I would like the "you have running jobs" warning to
> >disappear when leaving zsh, since the option should make it look like
> >other shells in that respect (e.g. bash prints no warnings about
> >background running jobs).
> 
> If you unset the MONITOR option, you won't get the warning.

I am not sure I follow you.
          MONITOR (-m)
               Allow job control.  Set by default in  interactive
               shells.
 
What does this have to do with what I have written?

-- 
hniksic@srce.hr              |  Student of electrical engineering
hniksic@fly.cc.fer.hr        |  University of Zagreb, Croatia
------------------------------------------------------------------
`VI' - An editor used by those heretics that don't subscribe to
       the Emacs religion.



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

* Re: "You have running jobs" warning
  1996-06-03 13:18   ` Hrvoje Niksic
@ 1996-06-03 13:37     ` Zefram
  1996-06-03 13:45       ` Hrvoje Niksic
  0 siblings, 1 reply; 10+ messages in thread
From: Zefram @ 1996-06-03 13:37 UTC (permalink / raw)
  To: hniksic; +Cc: A.Main, hniksic, zsh-workers

>I am not sure I follow you.
>          MONITOR (-m)
>               Allow job control.  Set by default in  interactive
>               shells.
> 
>What does this have to do with what I have written?

If you disable job control, you will not get the warning when
terminating the shell.

-zefram



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

* Re: "You have running jobs" warning
  1996-06-03 13:37     ` Zefram
@ 1996-06-03 13:45       ` Hrvoje Niksic
  1996-06-03 16:01         ` Zoltan Hidvegi
  0 siblings, 1 reply; 10+ messages in thread
From: Hrvoje Niksic @ 1996-06-03 13:45 UTC (permalink / raw)
  To: Zefram; +Cc: hniksic, A.Main, hniksic, zsh-workers

In your mail, you said:
> >I am not sure I follow you.
> >          MONITOR (-m)
> >               Allow job control.  Set by default in  interactive
> >               shells.
> > 
> >What does this have to do with what I have written?
> 
> If you disable job control, you will not get the warning when
> terminating the shell.

Well, yes of course. If I kill -9 $$, I will also get no warning, but it is
definitely not what I had in mind.

-- 
hniksic@srce.hr              |  Student of electrical engineering
hniksic@fly.cc.fer.hr        |  University of Zagreb, Croatia
------------------------------------------------------------------
`VI' - An editor used by those heretics that don't subscribe to
       the Emacs religion.



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

* Re: "You have running jobs" warning
  1996-06-03 13:45       ` Hrvoje Niksic
@ 1996-06-03 16:01         ` Zoltan Hidvegi
  1996-06-03 16:10           ` Hrvoje Niksic
  0 siblings, 1 reply; 10+ messages in thread
From: Zoltan Hidvegi @ 1996-06-03 16:01 UTC (permalink / raw)
  To: hniksic; +Cc: Zsh workers list

> In your mail, you said:
> > >I am not sure I follow you.
> > >          MONITOR (-m)
> > >               Allow job control.  Set by default in  interactive
> > >               shells.
> > > 
> > >What does this have to do with what I have written?
> > 
> > If you disable job control, you will not get the warning when
> > terminating the shell.
> 
> Well, yes of course. If I kill -9 $$, I will also get no warning, but it is
> definitely not what I had in mind.

You can alias exit to 'unsetopt monitor ; exit' or you can write an exit
function which checks if there are suspended jobs and exits unconditionally
if no suspended jobs found and gives a warning otherwise.  This way you can
write an exit which does exactly what you want.  The main point that this
can be done uning the existing shell tools so we should not complicate the
code with this.  Also many people (including myself) perfer the present
behaviour.  I always use setopt nohup but I'd still like to get warnings.

Zoltan



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

* Re: "You have running jobs" warning
  1996-06-03 16:01         ` Zoltan Hidvegi
@ 1996-06-03 16:10           ` Hrvoje Niksic
  0 siblings, 0 replies; 10+ messages in thread
From: Hrvoje Niksic @ 1996-06-03 16:10 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: hniksic, zsh-workers

In your mail, you said:
> code with this.  Also many people (including myself) perfer the present
> behaviour.  I always use setopt nohup but I'd still like to get warnings.

Yup, it does seem like a matter of taste, and since you're the
coordinator... ;)

-- 
hniksic@srce.hr              |  Student of electrical engineering
hniksic@fly.cc.fer.hr        |  University of Zagreb, Croatia
------------------------------------------------------------------
`VI' - An editor used by those heretics that don't subscribe to
       the Emacs religion.



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

* Re: "You have running jobs" warning
  1996-06-03 13:19 ` Hrvoje Niksic
@ 1996-06-03 13:41   ` Zoltan Hidvegi
  0 siblings, 0 replies; 10+ messages in thread
From: Zoltan Hidvegi @ 1996-06-03 13:41 UTC (permalink / raw)
  To: hniksic; +Cc: sinclair, zsh-workers, hniksic

> Well, it seems to be a matter of taste. When I background a job, it is most
> often quite normal to log out.

You can use 

% something &|
% exit

and zsh will not complain.

Zoltan



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

* Re: "You have running jobs" warning
  1996-06-03 10:31 Duncan Sinclair
@ 1996-06-03 13:19 ` Hrvoje Niksic
  1996-06-03 13:41   ` Zoltan Hidvegi
  0 siblings, 1 reply; 10+ messages in thread
From: Hrvoje Niksic @ 1996-06-03 13:19 UTC (permalink / raw)
  To: Duncan Sinclair; +Cc: zsh-workers, hniksic

In your mail, you said:
> <patch omitted>
> 
> I don't see this as logical at all.  I have "nohup" set but always
> appreciate the warning that zsh gives when I'm about to abandon a
> job.

Well, it seems to be a matter of taste. When I background a job, it is most
often quite normal to log out.

-- 
hniksic@srce.hr              |  Student of electrical engineering
hniksic@fly.cc.fer.hr        |  University of Zagreb, Croatia
------------------------------------------------------------------
`VI' - An editor used by those heretics that don't subscribe to
       the Emacs religion.



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

* Re: "You have running jobs" warning
@ 1996-06-03 10:31 Duncan Sinclair
  1996-06-03 13:19 ` Hrvoje Niksic
  0 siblings, 1 reply; 10+ messages in thread
From: Duncan Sinclair @ 1996-06-03 10:31 UTC (permalink / raw)
  To: zsh-workers; +Cc: Hrvoje Niksic


>When I set NO_HUP, I would like the "you have running jobs" warning to
>disappear when leaving zsh, since the option should make it look like
>other shells in that respect (e.g. bash prints no warnings about
>background running jobs).

>Thus, if nohup is unset, the warning should be printed and the shell
>should require pressing C-d twice to exit, HUP-ing the job before
>exiting.

>However, if nohup is set, there should be no warning about running
>background jobs, and only one C-d should be sufficient to exit. This
>little patch does this. Could you please include it to the
>distribution, since the modified behaviour strikes me as much more
>logical.

<patch omitted>

I don't see this as logical at all.  I have "nohup" set but always
appreciate the warning that zsh gives when I'm about to abandon a
job.

Perhaps another option to control this is what you require.


Duncan.



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

end of thread, other threads:[~1996-06-03 16:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-01 17:52 "You have running jobs" warning Hrvoje Niksic
1996-06-03 11:37 ` Zefram
1996-06-03 13:18   ` Hrvoje Niksic
1996-06-03 13:37     ` Zefram
1996-06-03 13:45       ` Hrvoje Niksic
1996-06-03 16:01         ` Zoltan Hidvegi
1996-06-03 16:10           ` Hrvoje Niksic
1996-06-03 10:31 Duncan Sinclair
1996-06-03 13:19 ` Hrvoje Niksic
1996-06-03 13:41   ` Zoltan Hidvegi

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