about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-18 00:48:14 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-18 00:48:14 +0000
commit1f2f3427ef93dd353c6d86e6b156c05d0ff4d982 (patch)
tree444bbaa293182e693f0cf1b1842308c4ea260765
parent7ef31c0ac9edba315f7645062341242afd45b6f0 (diff)
downloadzsh-1f2f3427ef93dd353c6d86e6b156c05d0ff4d982.tar.gz
zsh-1f2f3427ef93dd353c6d86e6b156c05d0ff4d982.tar.xz
zsh-1f2f3427ef93dd353c6d86e6b156c05d0ff4d982.zip
zsh-workers/8308
-rw-r--r--Doc/Zsh/options.yo8
-rw-r--r--Src/builtin.c3
-rw-r--r--Src/options.c1
-rw-r--r--Src/zsh.h1
4 files changed, 12 insertions, 1 deletions
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 8d10bdbb3..795d37a22 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -239,6 +239,14 @@ This also has the effect of tt(CHASE_DOTS), i.e. a `tt(..)' path segment
 will be treated as referring to the physical parent, even if the preceeding
 path segment is a symbolic link.
 )
+pindex(CHECK_JOBS)
+cindex(exiting, checking jobs when)
+cindex(logging out, checking jobs when)
+item(tt(CHECK_JOBS) <Z>)(
+Report the status of background and suspended jobs before exiting a shell
+with job control.  tt(NO_CHECK_JOBS) is best used only in combination with
+tt(NO_HUP), else such jobs will be killed automatically.
+)
 pindex(CLOBBER)
 cindex(clobbering, of files)
 cindex(file clobbering, allowing)
diff --git a/Src/builtin.c b/Src/builtin.c
index a7c03acef..acefcd111 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3153,7 +3153,8 @@ zexit(int val, int from_signal)
     HEAPALLOC {
 	if (isset(MONITOR) && !stopmsg && !from_signal) {
 	    scanjobs();    /* check if jobs need printing           */
-	    checkjobs();   /* check if any jobs are running/stopped */
+	    if (isset(CHECKJOBS))
+	        checkjobs();   /* check if any jobs are running/stopped */
 	    if (stopmsg) {
 		stopmsg = 2;
 		LASTALLOC_RETURN;
diff --git a/Src/options.c b/Src/options.c
index 878ab2247..2fd2ae373 100644
--- a/Src/options.c
+++ b/Src/options.c
@@ -93,6 +93,7 @@ static struct optname optns[] = {
 {NULL, "cdablevars",	      OPT_EMULATE,		 CDABLEVARS},
 {NULL, "chasedots",	      OPT_EMULATE,		 CHASEDOTS},
 {NULL, "chaselinks",	      OPT_EMULATE,		 CHASELINKS},
+{NULL, "checkjobs",	      OPT_EMULATE|OPT_ZSH,	 CHECKJOBS},
 {NULL, "clobber",	      OPT_EMULATE|OPT_ALL,	 CLOBBER},
 {NULL, "completealiases",     0,			 COMPLETEALIASES},
 {NULL, "completeinword",      0,			 COMPLETEINWORD},
diff --git a/Src/zsh.h b/Src/zsh.h
index 9a5699160..c34b2bd53 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1267,6 +1267,7 @@ enum {
     CDABLEVARS,
     CHASEDOTS,
     CHASELINKS,
+    CHECKJOBS,
     CLOBBER,
     COMPLETEALIASES,
     COMPLETEINWORD,