My 2018 MacBook Pro is connected to external displays and peripherals via a Thunderbolt 3 dock.

When I step away from my desk I lock the computer by pressing ctrl+cmd+Q on my external keyboard.

This works as expected, kicking the system back to the lock screen.

However, after a few minutes of this state, the system goes to sleep, turning off the screen and requiring time to become interactive again after jabbing the power button.

How can I prevent the laptop from going to sleep once locked if connected to power? The most important aspect of this is that Touch ID stays active, so I can instantly resume work at my desk with a single touch of the sensor.


2 Answers 2


This can be done in Energy Saver:

  1. Open System Preferences
  2. Go to Energy Saver
  3. Select Power Adapter
  4. Check/mark the "Prevent computer from sleeping automatically when the display is off" option
  5. [Optional] Uncheck "Put hard disks to sleep when possible".
sudo caffeinate -s -u

man caffeinate

 -s      Create an assertion to prevent the system from sleeping. This
         assertion is valid only when system is running on AC power.
 -u      Create an assertion to declare that user is active. If the dis-
         play is off, this option turns the display on and prevents the
         display from going into idle sleep. If a timeout is not specified
         with '-t' option, then this assertion is taken with a default of
         5 second timeout.

Not the answer you're looking for? Browse other questions tagged .