If your Mac won't go to sleep, or Sleep is greyed out, after sudo pmset disablesleep 1, 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 with nothing left on to forget, Clamshell for Mac does it per session, without sudo.
An animated MacBook with a coding agent deploying a website from its terminal. The Option key is held and the lid closes: the display goes black, but the Mac stays awake, so a dimmed copy of the terminal keeps working above the closed laptop while its front edge fills with light. When the deploy is done, a pointer shows how to lift the lid. Opening it wakes the Mac to its lock screen, which unlocks to the finished run: deployed, with the live address. The lid can then be opened and closed freely.
Clamshell for Mac keeps a closed MacBook awake only while armed and leaves nothing to undo. Free for 7 days.
Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or install with Homebrew: brew install --cask clamshell.
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.
Need a keep-awake command that ends on its own next time? Use the caffeinate and pmset command builder.
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 with nothing to undo
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 you can switch off without sudo.
Clamshell for Mac is a menu bar app for Apple Silicon MacBooks on macOS 14 or later. It keeps the Mac awake with the lid closed only while armed, and leaves nothing to undo:
- No sudo, no admin password, no kernel extension or privileged helper.
- You choose how long. 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 with a lid angle sensor (the 14-inch and 16-inch MacBook Pro from 2021 on, and some newer MacBook Air models). Right-click and Shortcuts arming stay on across reopenings until you disarm.
- A restart restores normal lid sleep. Disarm or quit and it comes back too. Clamshell warns you if that does not complete.
- 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.
Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or install with Homebrew: brew install --cask clamshell. Also on Setapp.
Other 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.
How I checked
On November 15, 2026, on a Mac running macOS 27.2 (build 26B123), every command on this page was checked against the pmset(1) manual on that Mac. It says -a applies a setting to all power sources, that changing any setting needs root, that -g shows the settings in use and that -g assertions lists what is holding the Mac awake. disablesleep itself is not in that manual. On the same Mac, pmset -g | grep SleepDisabled printed SleepDisabled 0 without sudo. The sudo pmset -a disablesleep 1 and 0 commands were not run for this check.
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.
My Mac won't go to sleep after disablesleep, or Sleep is greyed out. What do I check first?
Check the flag first: run pmset -g | grep SleepDisabled. If it reads 1, run sudo pmset -a disablesleep 0, enter an administrator password and check again; it should read 0. If it already reads 0, the flag is not the cause: run pmset -g assertions and quit the process holding PreventUserIdleSystemSleep or PreventSystemSleep.
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 sudo?
Use Apple's closed-display setup with an external display, or an app that needs no sudo to turn on or off. Clamshell for Mac is a menu bar app that keeps an Apple Silicon MacBook awake with the lid closed while armed, without sudo, and leaves nothing to undo. A restart always brings back normal lid sleep.
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.