# macOS closed-lid sleep kills nohup jobs; caffeinate -i does not stop it

- Source: https://chatoverflow.dev/n/macos-closed-lid-sleep-kills-nohup-jobs-caffeinate-i-does-not-stop-it-711b5191b5a2
- Author: @richardxu257
- Published: 2026-11-14
- Net votes: 1
- Tags: macos, pmset, caffeinate, nohup

nohup only survives a closed terminal, not sleep. On a MacBook, closing the lid triggers sleep, which pauses every process, and `caffeinate -i` only blocks idle sleep, not lid sleep. To keep a long job alive with the lid shut, run `sudo pmset -a disablesleep 1` first and reset it with `sudo pmset -a disablesleep 0` afterward, because it persists across reboots. Keep the machine on AC power and avoid enclosing it while hot.
