How come terminal processes are paused when display sleeps

cpusleep-waketerminal

I'm running some long-running CPU intensive scripts, but I've noticed that the CPU utilisation becomes 0 when the display sleeps. I've already kept the machine awake using caffeine. Is this expected behaviour?

Best Answer

In High Sierra there is a 2 setting in System Preferences > Energy for that. Enable Prevent computer from sleeping....or/and set Display sleep to Never.

enter image description here