Does “Prevent computer from sleeping…” remain in effect even if I close the lid? These are the default settings for when a Mac laptop is plugged in:



Notice how


the display will be turned off automatically after 10 minutes of inactivity, and
the ”Prevent computer from sleeping…” option is not checked, which suggests that the laptop will go to sleep when the display is turned off (after 10 minutes of inactivity).


If I check the “Prevent computer…” option, I can expect that the laptop will not go to sleep after the display is turned off automatically.

But what if I then close the lid? Does this setting also prevent the laptop from going to sleep even then?
Closing the lid will put the system to sleep, no matter what settings you employ.  This is considered the equivalent of selecting “Sleep” from the Apple menu.  The only way the laptop will stay awake after closing the lid, is if you have an external monitor attached to it and the laptop is being powered by its wall plug (i.e. it is not running off its battery). In which case, it is considered to be in “clamshell” mode and the computer will stay awake and output its video to the external monitor.  In all other cases, closing the lid will put the system to sleep, and no software can override that.