summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-07-03 08:48:22 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-07-03 08:48:22 +0000
commit43f3a585977a34d20e8ab2ac79d39183d1d02103 (patch)
tree49307e79ca0a998f8b93ab2f53dc78fdb3a52988
parent0ddb4fb835d685b5dc71dadc08d5758a28b99439 (diff)
downloadzsh-43f3a585977a34d20e8ab2ac79d39183d1d02103.tar.gz
zsh-43f3a585977a34d20e8ab2ac79d39183d1d02103.zip
12121: stopmsg in precmd
-rw-r--r--ChangeLog5
-rw-r--r--Doc/Zsh/options.yo10
-rw-r--r--Src/utils.c14
3 files changed, 23 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 96134245f..307e7e25f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-03 Peter Stephenson <pws@cambridgesiliconradio.com>
+
+ * 12121: Src/utils.c, Doc/Zsh/options.yo: save and restore stopmsg
+ for precmd, fix #ifdef's for variable declaration in read_poll().
+
2000-07-03 Sven Wischnowsky <wischnow@zsh.org>
* 12134: Completion/Core/_main_complete, Doc/Zsh/compsys.yo,
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 3b61a6871..84feb32c7 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -244,8 +244,14 @@ 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.
+with job control; a second attempt to exit the shell will succeed.
+tt(NO_CHECK_JOBS) is best used only in combination with tt(NO_HUP), else
+such jobs will be killed automatically.
+
+The check is omitted if the commands run from the previous command line
+included a `tt(jobs)' command, since it is assumed the user is aware that
+there are background or suspended jobs. A `tt(jobs)' command run from the
+tt(precmd) function is not counted for this purpose.
)
pindex(CLOBBER)
cindex(clobbering, of files)
diff --git a/Src/utils.c b/Src/utils.c
index f5242bbaa..955158831 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -644,11 +644,16 @@ preprompt(void)
/* If a shell function named "precmd" exists, *
* then execute it. */
if ((prog = getshfunc("precmd")) != &dummy_eprog) {
- int osc = sfcontext;
+ /*
+ * Save stopmsg, since user doesn't get a chance to respond
+ * to a list of jobs generated in precmd.
+ */
+ int osc = sfcontext, osm = stopmsg;
sfcontext = SFC_HOOK;
doshfunc("precmd", prog, NULL, 0, 1);
sfcontext = osc;
+ stopmsg = osm;
}
if (errflag)
return;
@@ -1316,12 +1321,13 @@ read_poll(int fd, int *readchar, int polltty)
int ret = 0;
long mode = -1;
char c;
-#ifdef FIONREAD
- int val;
-#endif
#ifdef HAVE_SELECT
fd_set foofd;
struct timeval expire_tv;
+#else
+#ifdef FIONREAD
+ int val;
+#endif
#endif
#ifdef HAS_TIO
struct ttyinfo ti;