---
title: sudo pmset disablesleep 1: what it does and how to undo it
description: It turns on SleepDisabled: no sleep at all, lid closed or not, even after a restart, until sudo pmset disablesleep 0. How to check it and undo it.
date: 2026-10-20
kicker: pmset
section: The closed lid, explained
related: caffeinate-lid-closed, clamshell-mode-without-external-monitor, macbook-lid-closed-heat-and-battery
order: 5
---

> **Short answer:** `sudo pmset disablesleep 1` turns on `SleepDisabled`, a system-wide power setting that stops the Mac from sleeping for any reason, closing the lid included, on AC power and on battery. It stays on, even after a restart, until you run `sudo pmset disablesleep 0`. To check it, run `pmset -g | grep SleepDisabled`: `SleepDisabled 1` means sleep is off; `0` or no output means normal sleep.

## What does sudo pmset disablesleep 1 do?

It sets `SleepDisabled` to true in the Mac's system-wide power settings, and macOS stops sleeping until it is set back. Idle sleep, Sleep in the Apple menu and closing the lid all stop putting the Mac to sleep.

As of October 2026 the option is not in `man pmset`; Apple's open-source `pmset` code defines it: "Any non-zero value of val (preferably 1) means DISABLE sleep. A zero value means ENABLE sleep" ([pmset.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmset/pmset.m#L5829)). `pmset` saves it to disk, and the power daemon, powerd, passes it to the kernel: "We write the settings to disk here; PM configd picks them up and sends them to xnu" ([pmset.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmset/pmset.m#L800)). In the kernel it is the first of the "conditions that prevent idle and demand system sleep", labeled a "user-space sleep kill switch" ([IOPMrootDomain.cpp](https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/iokit/Kernel/IOPMrootDomain.cpp#L7671)). This is Apple's published source; a given macOS release may differ in details.

### Is sudo pmset -a disablesleep 1 different?

No. The `-a`, `-b` and `-c` flags choose a power source for the regular settings, but `disablesleep` is stored as a system-wide setting "not tied to power source" ([pmset.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmset/pmset.m#L5107)). `sudo pmset -c disablesleep 1` does not make it AC-only.

## What does disablesleep not do?

It does not end by itself, it does not manage the display, and it does not care whether the Mac is plugged in.

- **No timer.** It stays on until you change it, and powerd applies it again at every startup ([PMSettings.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmconfigd/PMSettings.m#L1160)), so a restart does not undo it.
- **Not the display.** It controls system sleep only. Display sleep is a separate setting, `displaysleep` in `man pmset`, so a dark screen does not mean the Mac is asleep.
- **Not the power source.** It applies on battery too. In the kernel source it is checked before the low-battery and thermal conditions that otherwise force sleep, and Apple notes that "delaying, preventing, or allowing disruption of sleep may increase power consumption" ([Apple Support](https://support.apple.com/guide/mac-help/set-sleep-and-wake-settings-mchle41a6ccd/mac)).

## What can go wrong if you leave it on?

A Mac that cannot sleep: closing the lid, choosing Sleep or reaching a low battery no longer stops it, so a forgotten setting turns into heat and an empty battery.

- You close the lid and pack the Mac, and it keeps running inside the bag.
- On battery it keeps draining instead of sleeping.
- It is one shared value. Any other app or script that writes it can turn it off in the middle of your job, or leave it on after theirs.

> **Careful:** A closed MacBook that is awake still makes heat. Apple says to use a Mac laptop "on a stable work surface that allows for good ventilation" and not "in your bed, on a pillow, or under bedding" ([Apple Support](https://support.apple.com/en-us/102336)). Never leave an awake Mac in a bag. See [heat and battery with the lid closed](/blog/macbook-lid-closed-heat-and-battery).

## How do I check whether SleepDisabled is on?

Run `pmset -g | grep SleepDisabled`. `SleepDisabled 1` means sleep is off, `SleepDisabled 0` means normal sleep, and no output means the setting was never written, which is also normal sleep.

```sh
pmset -g | grep SleepDisabled
#  SleepDisabled    1
```

In the full `pmset -g` output it appears under `System-wide power settings:`, apart from the per-source settings ([pmset.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmset/pmset.m#L1184)). Do not confuse it with the `sleep` line, which is the idle sleep timer; a note such as `sleep 0 (sleep prevented by ...)` names apps holding assertions. `pmset -g` reads the saved setting. To see the value the kernel uses, run:

```sh
ioreg -r -n IOPMrootDomain -d 1 | grep SleepDisabled
#  "SleepDisabled" = Yes
```

Both commands only read; neither needs `sudo`.

## How do I undo pmset disablesleep?

Run `sudo pmset disablesleep 0`. powerd passes the change to the kernel when the preferences change ([PMSettings.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmconfigd/PMSettings.m#L1378)), so no restart is needed.

```sh
sudo pmset disablesleep 0
pmset -g | grep SleepDisabled                           # SleepDisabled 0
ioreg -r -n IOPMrootDomain -d 1 | grep SleepDisabled    # "SleepDisabled" = No
```

`SleepDisabled 0` stays in the list afterwards; that is the normal state.

## Why is pmset disablesleep not working?

Most often it ran without `sudo`, or the Mac is awake behind a dark screen.

- **No sudo.** `pmset` prints `'pmset' must be run as root...` and changes nothing ([pmset.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmset/pmset.m#L805)); the man page says "pmset must be run as root in order to modify any settings."
- **A dark screen.** The display sleeps on its own timer. `pmset -g log` "displays a history of sleeps, wakes, and other power management events", so you can see whether the Mac really slept.
- **Another tool.** Something else wrote the value back. Check again with `pmset -g`.

## How does Keep Mac Awake use the same setting?

Keep Mac Awake turns the same `SleepDisabled` setting on for one session you start, supervises it with a watchdog, and puts it back when the session ends. It changes it through a small system service, which is why the installer asks for the administrator password once.

- It refuses to start a session if `SleepDisabled` is already on, and never takes over a value something else set. If you turned it on by hand, run `sudo pmset disablesleep 0` first.
- Sessions: no limit, 1 hour, 8 hours or a custom number of hours up to 168. A session never starts by itself, and a timed one ends on time with normal sleep back.
- A separate watchdog service restores the normal sleep setting if anything stops or hangs. Quitting the app restores it too.
- AC power by default; unplugged, the session waits for power. Battery use is optional, down to a floor you pick, such as 20%, and a battery session ends at a serious thermal state.
- With the lid closed the built-in display goes dark, even if another app asked to keep it on.

From Terminal or an agent: `keepmacawake start --hours 8`, `keepmacawake status --json`, `keepmacawake stop`. It does not keep Wi-Fi alive and does not wake a Mac that is already asleep.

## What to use

For a short job you will watch, `sudo pmset disablesleep 1` and `sudo pmset disablesleep 0` are free and enough; `caffeinate` is not, as [why caffeinate does not keep a MacBook awake with the lid closed](/blog/caffeinate-lid-closed) explains. To keep a MacBook with Apple silicon awake with the lid closed without having to remember the undo, Keep Mac Awake (keepmacawake.com) turns the same `SleepDisabled` setting on for one session you start on macOS 26 or later, supervises it with a watchdog and puts it back afterwards. See also [clamshell mode without an external monitor](/blog/clamshell-mode-without-external-monitor) and how to [keep a MacBook awake with the lid closed](/).

## FAQ

### What does pmset disablesleep 1 mean?

It turns on `SleepDisabled`, a system-wide switch that stops all sleep, including sleep when the lid closes. A value of `0` turns it off again.

### How do I undo sudo pmset disablesleep 1?

Run `sudo pmset disablesleep 0`, then check with `pmset -g | grep SleepDisabled`. It should print `SleepDisabled 0`.

### Does pmset disablesleep stay on after a restart?

Yes. It is saved to disk and applied again at startup, so it stays on until you run `sudo pmset disablesleep 0`.

### Does pmset disablesleep work on battery?

Yes. It is not tied to a power source, so the Mac stays awake on battery too and keeps using it.

### Why won't Keep Mac Awake start when SleepDisabled is on?

It never takes over a sleep setting that something else turned on. Run `sudo pmset disablesleep 0`, then start the session.

## Sources

- [Apple open source: pmset.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmset/pmset.m) and [man pmset](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmset/pmset.1)
- [Apple open source: PMSettings.m](https://github.com/apple-oss-distributions/PowerManagement/blob/d415e45501842834a280930c3eed9186544a67f0/pmconfigd/PMSettings.m)
- [Apple open source: IOPMrootDomain.cpp](https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/iokit/Kernel/IOPMrootDomain.cpp)
- [Apple Support: Set sleep and wake settings for your Mac](https://support.apple.com/guide/mac-help/set-sleep-and-wake-settings-mchle41a6ccd/mac)
- [Apple Support: Mac laptop operating temperatures](https://support.apple.com/en-us/102336)
- [Keep Mac Awake: command line](https://keepmacawake.com/command-line.md)
