summaryrefslogtreecommitdiff
path: root/jobs.c
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>1997-09-22 20:22:27 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:51 +0000
commite8ce775db824de329b81293b4e5d8fbd65624528 (patch)
tree4b20c4dc766f5172b65ca1bc16ae1b6d48920fa1 /jobs.c
parentd166f048818e10cf3799aa24a174fb22835f1acc (diff)
downloadbash-e8ce775db824de329b81293b4e5d8fbd65624528.tar.gz
Imported from ../bash-2.01.1.tar.gz.
Diffstat (limited to 'jobs.c')
-rw-r--r--jobs.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/jobs.c b/jobs.c
index bd10cd01..0218f3ff 100644
--- a/jobs.c
+++ b/jobs.c
@@ -1694,7 +1694,15 @@ wait_for (pid)
if (interactive_shell && subshell_environment == 0)
{
if (WIFSIGNALED (child->status) || WIFSTOPPED (child->status))
- set_tty_state ();
+ {
+ set_tty_state ();
+ /* If the foreground job was suspended with ^Z (SIGTSTP), and
+ the user has requested it, get a new window size. */
+ if (check_window_size && WIFSTOPPED (child->status) &&
+ (WSTOPSIG (child->status) == SIGTSTP) &&
+ job == current_job)
+ get_new_window_size (0);
+ }
else
get_tty_state ();
@@ -2318,6 +2326,13 @@ waitchld (wpid, block)
the signal to ourselves. */
SigHandler *temp_handler;
temp_handler = old_sigint_handler;
+ /* Bogus. If we've reset the signal handler as the result
+ of a trap caught on SIGINT, then old_sigint_handler
+ will point to trap_handler, which now knows nothing about
+ SIGINT (if we reset the sighandler to the default).
+ In this case, we have to fix things up. What a crock. */
+ if (temp_handler == trap_handler && signal_is_trapped (SIGINT) == 0)
+ temp_handler = trap_to_sighandler (SIGINT);
restore_sigint_handler ();
if (temp_handler == SIG_DFL)
termination_unwind_protect (SIGINT);