pmset
sudo pmset disablesleep 1: what it does and how to undo it
It turns on SleepDisabled: no sleep at all, lid closed or not, even after a restart, until sudo pmset disablesleep 0. How to check it and undo it.
Short answer:
sudo pmset disablesleep 1turns onSleepDisabled, a system-wide power setting that stops the Mac from sleeping for any reason, closing the lid included, on AC power and on battery. It stays on, even after a restart, until you runsudo pmset disablesleep 0. To check it, runpmset -g | grep SleepDisabled:SleepDisabled 1means sleep is off;0or no output means normal sleep.
What does sudo pmset disablesleep 1 do?
It sets SleepDisabled to true in the Mac's system-wide power settings, and macOS stops sleeping until it is set back. Idle sleep, Sleep in the Apple menu and closing the lid all stop putting the Mac to sleep.
As of October 2026 the option is not in man pmset; Apple's open-source pmset code defines it: "Any non-zero value of val (preferably 1) means DISABLE sleep. A zero value means ENABLE sleep" (pmset.m). pmset saves it to disk, and the power daemon, powerd, passes it to the kernel: "We write the settings to disk here; PM configd picks them up and sends them to xnu" (pmset.m). In the kernel it is the first of the "conditions that prevent idle and demand system sleep", labeled a "user-space sleep kill switch" (IOPMrootDomain.cpp). This is Apple's published source; a given macOS release may differ in details.
Is sudo pmset -a disablesleep 1 different?
No. The -a, -b and -c flags choose a power source for the regular settings, but disablesleep is stored as a system-wide setting "not tied to power source" (pmset.m). sudo pmset -c disablesleep 1 does not make it AC-only.
What does disablesleep not do?
It does not end by itself, it does not manage the display, and it does not care whether the Mac is plugged in.
- No timer. It stays on until you change it, and powerd applies it again at every startup (PMSettings.m), so a restart does not undo it.
- Not the display. It controls system sleep only. Display sleep is a separate setting,
displaysleepinman pmset, so a dark screen does not mean the Mac is asleep. - Not the power source. It applies on battery too. In the kernel source it is checked before the low-battery and thermal conditions that otherwise force sleep, and Apple notes that "delaying, preventing, or allowing disruption of sleep may increase power consumption" (Apple Support).
What can go wrong if you leave it on?
A Mac that cannot sleep: closing the lid, choosing Sleep or reaching a low battery no longer stops it, so a forgotten setting turns into heat and an empty battery.
- You close the lid and pack the Mac, and it keeps running inside the bag.
- On battery it keeps draining instead of sleeping.
- It is one shared value. Any other app or script that writes it can turn it off in the middle of your job, or leave it on after theirs.
Careful: A closed MacBook that is awake still makes heat. Apple says to use a Mac laptop "on a stable work surface that allows for good ventilation" and not "in your bed, on a pillow, or under bedding" (Apple Support). Never leave an awake Mac in a bag. See heat and battery with the lid closed.
How do I check whether SleepDisabled is on?
Run pmset -g | grep SleepDisabled. SleepDisabled 1 means sleep is off, SleepDisabled 0 means normal sleep, and no output means the setting was never written, which is also normal sleep.
pmset -g | grep SleepDisabled
# SleepDisabled 1
In the full pmset -g output it appears under System-wide power settings:, apart from the per-source settings (pmset.m). Do not confuse it with the sleep line, which is the idle sleep timer; a note such as sleep 0 (sleep prevented by ...) names apps holding assertions. pmset -g reads the saved setting. To see the value the kernel uses, run:
ioreg -r -n IOPMrootDomain -d 1 | grep SleepDisabled
# "SleepDisabled" = Yes
Both commands only read; neither needs sudo.
How do I undo pmset disablesleep?
Run sudo pmset disablesleep 0. powerd passes the change to the kernel when the preferences change (PMSettings.m), so no restart is needed.
sudo pmset disablesleep 0
pmset -g | grep SleepDisabled # SleepDisabled 0
ioreg -r -n IOPMrootDomain -d 1 | grep SleepDisabled # "SleepDisabled" = No
SleepDisabled 0 stays in the list afterwards; that is the normal state.
Why is pmset disablesleep not working?
Most often it ran without sudo, or the Mac is awake behind a dark screen.
- No sudo.
pmsetprints'pmset' must be run as root...and changes nothing (pmset.m); the man page says "pmset must be run as root in order to modify any settings." - A dark screen. The display sleeps on its own timer.
pmset -g log"displays a history of sleeps, wakes, and other power management events", so you can see whether the Mac really slept. - Another tool. Something else wrote the value back. Check again with
pmset -g.
How does Keep Mac Awake use the same setting?
Keep Mac Awake turns the same SleepDisabled setting on for one session you start, supervises it with a watchdog, and puts it back when the session ends. It changes it through a small system service, which is why the installer asks for the administrator password once.
- It refuses to start a session if
SleepDisabledis already on, and never takes over a value something else set. If you turned it on by hand, runsudo pmset disablesleep 0first. - Sessions: no limit, 1 hour, 8 hours or a custom number of hours up to 168. A session never starts by itself, and a timed one ends on time with normal sleep back.
- A separate watchdog service restores the normal sleep setting if anything stops or hangs. Quitting the app restores it too.
- AC power by default; unplugged, the session waits for power. Battery use is optional, down to a floor you pick, such as 20%, and a battery session ends at a serious thermal state.
- With the lid closed the built-in display goes dark, even if another app asked to keep it on.
From Terminal or an agent: keepmacawake start --hours 8, keepmacawake status --json, keepmacawake stop. It does not keep Wi-Fi alive and does not wake a Mac that is already asleep.
What to use
For a short job you will watch, sudo pmset disablesleep 1 and sudo pmset disablesleep 0 are free and enough; caffeinate is not, as why caffeinate does not keep a MacBook awake with the lid closed explains. To keep a MacBook with Apple silicon awake with the lid closed without having to remember the undo, Keep Mac Awake (keepmacawake.com) turns the same SleepDisabled setting on for one session you start on macOS 26 or later, supervises it with a watchdog and puts it back afterwards. See also clamshell mode without an external monitor and how to keep a MacBook awake with the lid closed.
FAQ
What does pmset disablesleep 1 mean?
It turns on SleepDisabled, a system-wide switch that stops all sleep, including sleep when the lid closes. A value of 0 turns it off again.
How do I undo sudo pmset disablesleep 1?
Run sudo pmset disablesleep 0, then check with pmset -g | grep SleepDisabled. It should print SleepDisabled 0.
Does pmset disablesleep stay on after a restart?
Yes. It is saved to disk and applied again at startup, so it stays on until you run sudo pmset disablesleep 0.
Does pmset disablesleep work on battery?
Yes. It is not tied to a power source, so the Mac stays awake on battery too and keeps using it.
Why won't Keep Mac Awake start when SleepDisabled is on?
It never takes over a sleep setting that something else turned on. Run sudo pmset disablesleep 0, then start the session.