Run sudo pmset -a disablesleep 0, then check that pmset -g | grep SleepDisabled reads 0. Closing Terminal or restarting is not the off switch. If you want lid-closed work without a global flag to forget, Clamshell for Mac does it per session, without sudo.
Clamshell for Mac keeps a closed MacBook awake only while armed and never touches SleepDisabled. Free for 7 days.
Download free trialApple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99
You ran sudo pmset -a disablesleep 1, usually to keep a MacBook working with the lid closed, and now the Mac never sleeps. Or you inherited a Mac that stays awake in a bag and drains overnight. This is common enough that an Ask Different question titled "How do I reset: sudo pmset -a disablesleep 1" had 1,704 views as of October 5, 2026. Here is the exact fix, how to confirm it, and why the setting outlives your Terminal window.
Is SleepDisabled stuck at 1? How to check
Open Terminal and run:
pmset -g | grep SleepDisabled
No sudo is needed to read it. pmset -g lists current power settings, and SleepDisabled appears under the system-wide settings as one value, not per power source. 1 means system sleep is disabled. 0 means normal sleep behavior.
How to turn pmset disablesleep off
- Run the inverse command. Enter your administrator password when asked. Nothing is printed on success.
sudo pmset -a disablesleep 0 - Confirm it reads 0.
pmset -g | grep SleepDisabled - Test it. On a MacBook with no external display, close the lid for a few seconds and reopen it. The Mac should have slept. You can also choose Sleep from the Apple menu.
- Check again after your next restart. If it reads 1 again, something is setting it back (see below).
The -a flag means all power sources. Use it for the undo even if you originally typed -c or -b: SleepDisabled is reported as one system-wide value, so the safest undo covers everything.
Skip restoredefaults for this. sudo pmset restoredefaults resets power management settings as a group, per the pmset manual. That wipes any settings you changed on purpose. Undo the one setting instead.
Why pmset disablesleep survives a restart
caffeinate holds a power assertion that belongs to a process: quit the process and the assertion is gone. disablesleep is different. It writes a saved system setting. On the Mac this guide was written on, the value lives in /Library/Preferences/com.apple.PowerManagement.plist under SystemPowerSettings, next to the other pmset settings. That is why:
- Closing Terminal does nothing. No process owns the flag.
- Logging out does nothing. It is a system setting, not a user one.
- Restarting is not a reliable reset. Treat it as persistent and check after a restart. The top-voted answer on the Ask Different question suggests resetting the SMC, but the direct fix is the one-line inverse command.
Also worth knowing: disablesleep does not appear in the list of settings in the current pmset(1) manual. It is an undocumented switch, so Apple can change how it behaves.
Mac still won't sleep after disablesleep 0?
If SleepDisabled reads 0 and the Mac still stays awake, the flag was not the cause. Look at power assertions, which are what apps and commands use to hold off sleep:
pmset -g assertions
Look for a non-zero PreventUserIdleSystemSleep or PreventSystemSleep and the processes listed as owning them. A leftover caffeinate, a keep-awake app, a download or a media player are typical. Quit the owner and check again.
If SleepDisabled keeps flipping back to 1 (or to 0 when you wanted 1), another app is writing it. Keep-awake apps that use this flag can toggle it on their own schedule. For example, a BatFi issue (closed as of October 2026) reported that app's helper resetting SleepDisabled to 0 within minutes. Quit apps that manage sleep, set the value you want, and watch it with pmset -g | grep SleepDisabled.
What leaving disablesleep on can do
- The Mac never sleeps, anywhere. On the charger, on battery, lid open, lid closed, with no timer and no menu bar indicator. A Mac put away with it on can be flat by morning.
- Heat in a bag. A workload that would normally stop at lid close keeps running with restricted airflow. Nothing in the flag watches temperature.
- The display may stay on. One Hacker News commenter noted that the command alone prevents sleep on lid close but does not turn off the display.
pmset displaysleepnowturns the display off immediately, per the manual. - It needs admin rights both ways. A standard account cannot set or clear it, and every change prompts for a password.
Keep lid-closed work without the stuck flag
Most people set disablesleep 1 for one reason: to keep a MacBook working with the lid closed and no monitor, often for a coding agent, a download or a remote session. If that is still the goal, use a tool scoped to the session.
Clamshell for Mac is a menu bar app for Apple Silicon MacBooks on macOS 14 or later. It does not run pmset disablesleep and never changes SleepDisabled. While armed it uses the unprivileged IOKit lid sleep-state control plus an idle-sleep assertion, the same kind caffeinate creates. That gives it different failure modes from the flag:
- No sudo, no admin password, no kernel extension or privileged helper.
- Scoped to a session. Arming from the menu bar menu covers the next close only. Holding Option while closing the lid is a one-close action on a MacBook Air M2 (2022) or later or a 14-inch or 16-inch MacBook Pro (2021) or later. Shortcuts and right-click arming stay on across reopenings until you disarm.
- Never saved across a restart. Disarm or quit and normal lid sleep comes back. Clamshell retries and warns you if macOS refuses.
- Thermal safety is always on. At serious or critical macOS thermal pressure it disarms toward normal lid sleep and blocks arming until the Mac cools. That is not a reason to run it in a bag.
- The built-in display stays black while the lid is closed, and the Mac stays on the network for SSH and screen sharing.
Clamshell keeps your Mac awake with the lid closed while armed. Free for 7 days, then $9.99 once for one Mac. 14-day money-back guarantee.
Download free trialOther ways to keep a closed Mac awake
Keep using disablesleep, carefully
Free and built in. If you stay with it, pair every disablesleep 1 with a disablesleep 0 in the same script, and check pmset -g before you pack the Mac. The pmset disablesleep guide covers the details.
Use an external display
Apple's closed-display mode keeps a MacBook awake with the lid closed when it has power, an external display, keyboard and mouse. The right choice at a desk.
Leave the lid open with caffeinate
caffeinate -i your-command keeps the Mac awake while one command runs, then lets go. It does not cover a closed lid: see why caffeinate does not work with the lid closed.
A keep-awake app
Amphetamine's Closed-Display Mode can keep a lid-closed Mac awake; if it is misbehaving, see Amphetamine not working with the lid closed. KeepingYouAwake is lid-open only, as its lid-closed guide explains.
Frequently asked questions
How do I undo sudo pmset disablesleep 1?
Run sudo pmset -a disablesleep 0 in Terminal and enter an administrator password. Then run pmset -g | grep SleepDisabled and confirm it reads 0.
Does restarting the Mac reset pmset disablesleep?
Do not count on it. macOS stores SleepDisabled with its other system power settings in /Library/Preferences/com.apple.PowerManagement.plist, so it is a saved setting, not a running process. Closing Terminal does not undo it. Set it back to 0 explicitly and check it again after a restart.
Why does my Mac still not sleep after I set disablesleep to 0?
First confirm the flag with pmset -g | grep SleepDisabled. If it reads 0, something else is holding the Mac awake. Run pmset -g assertions and look for apps or processes holding PreventUserIdleSystemSleep or PreventSystemSleep, then quit them.
Can I undo disablesleep without an admin password?
No. Changing it needs sudo, and sudo needs an administrator account. If your account is a standard user, ask an administrator to run sudo pmset -a disablesleep 0 for you.
Should I use sudo pmset restoredefaults instead?
Only if you want every power management setting reset. restoredefaults resets power settings as a group, which is broader than undoing one change. sudo pmset -a disablesleep 0 undoes exactly this one setting.
How do I keep a MacBook awake with the lid closed without disablesleep?
Use Apple's closed-display setup with an external display, or a session-scoped tool. Clamshell for Mac is a menu bar app that keeps an Apple Silicon MacBook awake with the lid closed while armed, without sudo, and never changes SleepDisabled. Its lid sleep change is never saved across a restart.
Related guides
- sudo pmset disablesleep 1: what it does and whether it is safe
- Why caffeinate does not work with the lid closed
- Clamshell vs Amphetamine vs pmset
- Amphetamine not working with the lid closed
- KeepingYouAwake with the lid closed
- Keep a MacBook awake with the lid closed
Sources checked October 5, 2026: the macOS pmset(1) manual, the SleepDisabled entry in /Library/Preferences/com.apple.PowerManagement.plist on an Apple Silicon MacBook, Ask Different question 468382, BatFi issue #148, a Hacker News comment, and Apple's closed-display guidance. Clamshell behavior is described from its changelog and FAQ. Clamshell is the publisher of this guide.