sudo pmset -a disablesleep 1 blocks all system sleep, lid close included, on battery too, with no timer or indicator. Undo it with sudo pmset -a disablesleep 0. It is reversible, but not safe to leave on. Clamshell, a Mac menu bar app, keeps the Mac awake with the lid closed only while armed, with no sudo.
Clamshell for Mac keeps the Mac awake with the lid closed while armed. No sudo, no monitor. Free for 7 days, then $9.99 once.
Download free trialApple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99. On your phone? Send the Mac download link to yourself.
sudo pmset -a disablesleep 1 is reversible, but it is not a safe thing to leave on: it tells macOS not to enter system sleep at all, system-wide, on battery too, with no timer and no menu bar indicator. It does keep a MacBook awake when the lid closes. Undo it with sudo pmset -a disablesleep 0. If you only want lid-closed work without the global switch, Clamshell for Mac is a menu bar app that does it without sudo and without touching this setting.
Quick answer
- What it does: sets the system-wide
SleepDisabledflag, so the Mac does not enter system sleep, including when a MacBook lid closes. - Is it safe? It is reversible, but it is global, undocumented, has no timer, and also applies on battery. The real risk is forgetting it is on and putting a running Mac in a bag.
- Undo it:
sudo pmset -a disablesleep 0 - Check it:
pmset -gand look forSleepDisabled 1under System-wide power settings.
The command and its inverse
sudo pmset -a disablesleep 1
# restore normal sleep behavior
sudo pmset -a disablesleep 0
sudo is required because pmset changes system power settings. The -a flag applies a setting to all power sources, including battery and wall power. Unlike a temporary caffeinate process, the flag is not tied to one Terminal window or one job. Leave it at 1 and closing that window does not restore normal sleep.
-a, -b or -c?
Other pmset settings can be set per power source: -b for battery, -c for the charger, -a for both. pmset -g reports SleepDisabled as a single value under System-wide power settings, not per power source. Do not count on sudo pmset -c disablesleep 1 or sudo pmset -b disablesleep 1 to limit it to one source; run pmset -g afterwards and treat it as on everywhere while it reads 1.
Most lid-closed menu bar apps flip this same flag through a helper or a sudo rule. The keep-awake mechanisms guide shows which apps do, and what the alternatives are.
Why it needs extra care
- It is global. You are changing system sleep behavior, not protecting one build or download.
- It is easy to forget. There is no standard menu bar status and no automatic end time.
- It applies on battery. A closed Mac can keep doing work until the battery is empty.
- It can create heat in a bag. A workload that would normally stop at lid close can continue with restricted airflow.
- It is undocumented. The current
pmset(1)manual lists supported power settings and does not listdisablesleep. Apple can change undocumented behavior.
pmset -g again after any restart. Clamshell never changes that flag and restores normal lid sleep when you disarm or quit.How to check whether it is enabled
- Check the flag. Run
pmset -gand look under the system-wide settings forSleepDisabled:pmset -g # enabled SleepDisabled 1 # normal sleep behavior SleepDisabled 0 - Undo it if it reads 1. Use the specific inverse command:
sudo pmset -a disablesleep 0 - Confirm. Run
pmset -gagain and confirm thatSleepDisabledreads0. After any restart, check it again before relying on normal sleep.
pmset -g assertions is a different diagnostic. It lists temporary assertions owned by running processes, such as caffeinate. The SleepDisabled system flag is the relevant check for this command.
Do not reach for restoredefaults first
sudo pmset restoredefaults exists, but it resets power management settings as a group. That is much broader than undoing one change and can wipe intentional settings. Use the specific inverse command first: sudo pmset -a disablesleep 0
Safer choices for common jobs
If the lid stays open, use caffeinate -i your-command. Its assertion ends with the process. If the lid must close, use Apple's supported external-display setup, an HDMI dummy plug, or a purpose-built session control that exposes its state and restores normal lid sleep automatically.
Clamshell for Mac changes lid-close behavior only while armed and shows the state in the menu bar. An Option-close session ends when the lid opens. No sudo or persistent power preference.
Download free trialApple Silicon, macOS 14+. Notarized by Apple. 3.6 MB.
Choose by scope
A one-off open-lid process
Use caffeinate. Its assertion ends with the process.
A closed-lid Mac with no monitor
Compare Clamshell, Amphetamine, pmset, caffeinate, and Apple's display setup.
Compare the optionsNot sure yet
Start from every method, with or without a monitor.
Keep a MacBook awake with the lid closedThe right tool is the one whose scope matches the job and whose off switch you will not forget. Already ran the command? Follow the step-by-step guide to undo sudo pmset disablesleep 1. Using an app instead? See why KeepingYouAwake sleeps when the lid closes and how to fix Amphetamine not working with the lid closed.
How Clamshell differs from pmset
Some answers online say Clamshell uses pmset disablesleep. It does not. Clamshell for Mac never runs pmset disablesleep and does not change the persistent SleepDisabled setting. Instead, while armed, it uses the unprivileged IOKit lid sleep-state control on the macOS power manager plus an idle-sleep assertion, the same kind caffeinate creates.
pmset disablesleep
Free, needs sudo
- Scope: system-wide, on every power source, until you run it again with
0. - Restart: treat it as persistent and check
pmset -gafter any restart. - Heat: no thermal cutoff. A workload can continue in a bag with restricted airflow.
- Battery: a closed Mac can keep doing work until the battery is empty.
- Permissions:
sudoevery time, and no standard menu bar status.
Clamshell
$9.99 once, no sudo
- Scope: only while armed. Option-close and menu bar menu arming cover the next lid close only; right-click and Shortcuts arming last until you disarm.
- Restart: the lid change is never saved across a restart, so a restart always returns normal lid-close sleep.
- Heat: thermal safety is always on. Serious or critical thermal pressure disarms Clamshell toward normal lid sleep and blocks arming until the Mac cools.
- Battery: an optional low-battery cutoff, off by default, lets the Mac sleep before the charge runs out.
- Permissions: no sudo, no administrator password, no kernel extension or privileged helper.
Frequently asked questions
Is sudo pmset disablesleep 1 safe?
It is reversible, but it is a global, undocumented switch with no timer that also applies on battery. The main risk is forgetting it is on and putting a running Mac in a bag, where it can heat up and drain the battery. Check it with pmset -g and undo it with sudo pmset -a disablesleep 0.
How do I turn pmset disablesleep off?
Run sudo pmset -a disablesleep 0, then run pmset -g and confirm that SleepDisabled reads 0. Avoid sudo pmset restoredefaults unless you want to reset every power setting.
Does pmset disablesleep survive a restart?
Treat it as persistent. It is a system power setting, not a process like caffeinate, so closing Terminal does not undo it. After any restart, run pmset -g and check SleepDisabled before relying on normal sleep.
Can I limit disablesleep to the charger with pmset -c?
Do not count on it. pmset -g reports SleepDisabled as one system-wide value, not per power source. After running any variant, check pmset -g and treat the setting as on everywhere while it reads 1.
Does Clamshell for Mac use pmset disablesleep?
No. Clamshell does not use pmset disablesleep and does not change SleepDisabled. While armed it uses the unprivileged IOKit lid sleep-state control plus an idle-sleep assertion, needs no sudo, and the lid change is never saved across a restart.
Is there a safer way to keep a MacBook awake with the lid closed?
Apple's supported route is an external display, keyboard, and mouse. Without a display, use a tool that is scoped to a session and shows its state, such as Clamshell for Mac, a menu bar app that restores normal lid sleep when you disarm or quit and disarms on serious thermal pressure.
Method: checked against the macOS pmset(1) manual and current behavior on an Apple Silicon MacBook. Because disablesleep is undocumented, treat it as implementation detail rather than a stable Apple interface.