title: Detaching a background process in zsh so that I can close the terminal
body: <p>I have a terminal process running zsh in the Cygwin environment. I want to start a background process and then close the terminal process and have the background process running. However, when I exit the terminal, I get the error message that it can't exit, because a background process is still running. Example:</p>
  
  <pre><code>sleep 300 &amp;
  exit
  </code></pre>
  
  <p>I get the message <em>zsh: you have running jobs.</em></p>
  
  <p>The same with</p>
  
  <pre><code>nohup sleep 300 &amp;
  </code></pre>
  
  <p>From the man page of zsh, I see that there is a command called <em>disown</em> which, from the description, might do what I want, but I don't know how to use it. According to the man page, it expects an argument <em>job</em>, but doesn't say what this argument actually is. I tried</p>
  
  <pre><code>sleep 300 &amp;
  disown $!
  </code></pre>
  
  <p>but get the message <em>disown: job not found: 3964</em>, so a job is obviously not a PID.</p>
  
  <p>How can I do this correctly?</p>