zsh: suspended jobs

Ezra UNIX/Linux

I tried exiting a zsh terminal recently when I was greeted by a new error:

% exit

zsh: you have suspended jobs

What are the jobs? Well, zsh has a built-in command jobs which will tell you that!

% jobs

[1]  + suspended  yarn start

So, the first job is the problem - but how do you solve that?

Either:

  1. Pipe the job into a kill command

    % jobs -s | kill %1
    
  2. Find the PID for the job and then use that in a kill command.

    % jobs -l
    
    [1] + 35544 suspended yarn start
    
    % kill 35544
    

Once I understood what was preventing my terminal from closing, I was able to address the problem and move on with my day!