Mac won't sleep or Sleep is greyed out? How to undo pmset disablesleep 1

By Matyas Rathonyi. Updated November 15, 2026. Guides

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.

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

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.

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.

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:

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. Clamshell keeps the closed Mac awake only while armed, and a restart restores normal lid sleep. 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. Clamshell keeps the Mac awake only while armed: normal lid sleep returns when you disarm or quit, and a restart restores it too. 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 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:

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 you disarm it from the same menu, without sudo.

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

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.