How to undo sudo pmset disablesleep 1

By Matyas Rathonyi. Updated October 5, 2026. Guides

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.

Checkpmset -g, look for SleepDisabled
Undodisablesleep 0, with sudo
SavedStored on disk, not in Terminal
AdminNeeded to set or clear it

Clamshell for Mac keeps a closed MacBook awake only while armed and never touches SleepDisabled. Free for 7 days.

Download free trial

Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99

A terminal checks SleepDisabled and finds 1, runs sudo pmset -a disablesleep 0, checks again and finds 0. $ pmset -g | grep SleepDisabled SleepDisabled 1 $ sudo pmset -a disablesleep 0 $ pmset -g | grep SleepDisabled SleepDisabled 0
Check, undo, check again.Three commands. The second check matters: it is the only proof the change took.

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

  1. Run the inverse command. Enter your administrator password when asked. Nothing is printed on success.
    sudo pmset -a disablesleep 0
  2. Confirm it reads 0.
    pmset -g | grep SleepDisabled
  3. 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.
  4. 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:

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.

Three bars over time. The caffeinate assertion ends when Terminal quits. A Clamshell session ends at restart at the latest. SleepDisabled 1 keeps going past both until you set it to 0. caffeinate Clamshell disablesleep 1 quit Terminal restart
Different lifetimes. A caffeinate assertion dies with its process. A Clamshell session ends when you disarm or quit, and is never saved across a restart. SleepDisabled stays until you set it to 0.

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

With SleepDisabled 1, a closed MacBook keeps running on battery and the charge falls while heat builds. With normal sleep, the closed Mac sleeps and the charge holds. z SleepDisabled 1 keeps running SleepDisabled 0 sleeps at close
Same closed Mac, same bag. With the flag on, work keeps running and heat builds with nowhere to go. With it off, the lid closes and the Mac sleeps, which is what you want in a bag.

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:

Clamshell switches on and its status turns blue: armed for the next close only. Armed for the next close
A switch with an off state you can see. The armed state is in the menu bar, and nothing is written to SleepDisabled.

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 trial

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.

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

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.