3

When I'm in the terminal (either iTerm or Terminal.app) and have jobs running in the background, then typing exit or logout gives me:

There are stopped jobs.

which is fine and expected. The problem is that if I run exit or logout again (and repeatedly), I get the same thing.

isbadawi@astaire:~$ exit
logout
There are stopped jobs.
isbadawi@astaire:~$ exit
logout
There are stopped jobs.
isbadawi@astaire:~$ exit
logout
There are stopped jobs.
isbadawi@astaire:~$ exit
logout
There are stopped jobs.
isbadawi@astaire:~$ exit
logout
There are stopped jobs.
isbadawi@astaire:~$ exit
logout
There are stopped jobs.
isbadawi@astaire:~$ exit
logout
There are stopped jobs.

I've used bash on linux, and the behavior there was for the second invocation of exit or logout to go ahead and terminate the stopped jobs. Instead, I have to do this manually. Why is the behavior different, and is there a way to make it the same?

2
  • I can't reproduce it in a 10.9 VM, so check your configuration files. You could also try to install a newer version of bash by for example running brew install bash;echo /usr/local/bin/bash|sudo tee -a /etc/shells;chsh -s /usr/local/bin/bash.
    – Lri
    Commented May 2, 2014 at 13:36
  • @LaurieRanta Upgrading bash (to 4.3.11 from the system 3.2.51) seems to have fixed it! Commented May 2, 2014 at 21:10

1 Answer 1

6

If you have jobs that are stopped (with CTRL-z) or happened to be in the background but are stopped waiting for input, you can see what's there with the 'jobs' command.

If you only have a job, then a 'fg' will bring it to the front for you to interact with it or kill with a 'CTRL-c'. If you have multiple jobs, you can bring individual or specific ones with 'fg '.

1
  • I know about job control (this is what I was referring to by "do this manually"). I am asking why bash seems to behave differently on OS X and Linux in this instance. Commented Apr 30, 2014 at 22:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .