Is sudo pmset disablesleep 1 safe? What it does and how to undo it.

By Matyas Rathonyi. Updated October 8, 2026. Guides · Deutsche Version

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.

System-wideEvery power source, battery included
No timerOn until you turn it off
UndocumentedMissing from the pmset manual
ReversibleUndo with disablesleep 0

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 trial

Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99. On your phone? Send the Mac download link to yourself.

One switch, SleepDisabled 1, keeps a closed MacBook awake on the charger, then on battery, then inside a bag, until someone turns it off. SleepDisabled 1 charging on battery in a bag
One switch, still on after you walk away.The flag is not tied to a job or a window. It keeps the Mac awake at the desk, then on battery, then in a bag, until you set it back to 0.

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

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

pmset disablesleep stays at 1 after the job ends and must be checked again after a restart. Clamshell's lid control ends when you disarm or quit, and normal sleep returns. pmset disablesleep 1 job ends restart check it Clamshell disarm or quit normal sleep
A flag you have to remember, or a session that ends. SleepDisabled stays at 1 after the job ends until you set it back to 0, and you should check 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

  1. Check the flag. Run pmset -g and look under the system-wide settings for SleepDisabled:
    pmset -g
    
    # enabled
    SleepDisabled        1
    
    # normal sleep behavior
    SleepDisabled        0
  2. Undo it if it reads 1. Use the specific inverse command:
    sudo pmset -a disablesleep 0
  3. Confirm. Run pmset -g again and confirm that SleepDisabled reads 0. 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 trial

Apple 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.

What caffeinate covers

A closed-lid Mac with no monitor

Compare Clamshell, Amphetamine, pmset, caffeinate, and Apple's display setup.

Compare the options

Not sure yet

Start from every method, with or without a monitor.

Keep a MacBook awake with the lid closed

The Mac will run unplugged

Read how each option behaves on battery first.

Lid closed on battery

The 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 -g after 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: sudo every 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.