Back to Blog
Guide

pmset disablesleep: Keep a Mac Awake With the Lid Closed, and Undo It

sudo pmset -a disablesleep 1 stops all system sleep on a Mac, lid closed included, and sudo pmset -a disablesleep 0 turns normal sleep back on. How to check whether it is on, why it outlives a restart, and the pmset and caffeinate commands to use instead.

Slack Green Team
September 27, 2026
October 7, 2026
6 min read
Share:
mac
pmset
terminal
sleep

sudo pmset -a disablesleep 1 tells macOS never to enter system sleep, and that includes closing the lid of a MacBook with no external display. sudo pmset -a disablesleep 0 turns normal sleep back on at once. The setting needs an admin password, has no timer and no menu bar icon, and stays on after a restart. It is also missing from Apple's pmset manual page, though the pmset program on macOS 26.5.2 still contains it (output below). Check it with pmset -g, or without any password with ioreg, and undo it as soon as the job is done.

If the reason you want the Mac awake is to keep your Slack dot green, this command will not do it. The Slack desktop app sets you to away after 10 minutes without keyboard or mouse input on the Mac, even when the Mac never sleeps (Slack desktop 4.52.178 code, checked 7 Oct 2026).

The commands

sudo pmset -a disablesleep 1   # never sleep, lid closed included
sudo pmset -a disablesleep 0   # normal sleep again
pmset -g                       # check: look for SleepDisabled

sudo is needed because the change applies to the whole system, not to your user. The -a flag means all power sources (battery, charger and UPS). For disablesleep it makes no practical difference, because the flag is a single system-wide value rather than a per-power-source setting. Guides that write sudo pmset disablesleep 1 without -a set the same thing.

Nothing else changes. The display still turns off on its own timer, the screen still locks on its own timer, and closing the lid still turns off the built-in display. The CPU, network and disks keep running.

What we found on macOS 26.5.2

We checked a MacBook Pro (M2 Max, macOS 26.5.2, build 25F84) on 4 October 2026. None of these checks needs an admin password.

The manual does not know the word, but the program does:

$ man pmset | col -b | grep -ci disablesleep
0
$ strings /usr/bin/pmset | grep -n -E "disablesleep|SleepDisabled"
179:SleepDisabled
180: SleepDisabled
578:disablesleep

pmset -g cap lists the settings a Mac stores per power source. disablesleep is not among them, which is why it is one system-wide switch and -a, -b or -c make no difference:

$ pmset -g cap
Capabilities for AC Power:
 displaysleep
 disksleep
 sleep
 womp
 standby
 powernap
 ttyskeepawake
 hibernatemode
 hibernatefile
 tcpkeepalive
 lowpowermode

The power manager in the kernel reports the current value, so you can check it without sudo:

$ ioreg -r -c IOPMrootDomain | grep SleepDisabled
  |   "SleepDisabled" = No

Yes means disablesleep 1 is on. Our Mac said No, and its pmset -g System-wide section was empty.

pmset -g also names whatever is keeping the Mac awake right now. On our Mac, Amphetamine was running:

$ pmset -g
System-wide power settings:
Currently in use:
 ...
 sleep                1 (sleep prevented by Amphetamine, powerd)
 displaysleep         10 (display sleep prevented by Amphetamine, Aside)

If a Mac does not sleep and this line shows no app, check SleepDisabled next.

How to check whether disablesleep is on

Run pmset -g in Terminal. When the setting is on, the first section lists it:

System-wide power settings:
 SleepDisabled          1
Currently in use:
 ...

SleepDisabled 1 means sleep is off. SleepDisabled 0 means normal sleep. On a Mac where nobody ever set it, the line can be missing entirely, as on our test Mac. The ioreg line above gives the same answer as Yes or No.

The System-wide section reads /Library/Preferences/com.apple.PowerManagement.plist, under SystemPowerSettings, which is why the setting survives a restart. On our Mac that dictionary held one unrelated key (Update DarkWakeBG Setting) and no SleepDisabled. A Mac that stopped sleeping weeks ago, with no app running, is worth checking for this line first. Other causes, from Power Nap to apps that hold sleep assertions, are in why is my Mac not going to sleep.

pmset -g assertions answers a different question. It lists the running processes that are holding the Mac awake right now, such as caffeinate or Amphetamine. disablesleep does not show there, because it is a setting, not a process.

How to undo it

  • Run sudo pmset -a disablesleep 0 and enter your password.
  • Run pmset -g and confirm the line reads SleepDisabled 0.
  • Close the lid to test. The Mac should sleep within a few seconds.
  • There is no need to restart. Avoid sudo pmset restoredefaults as a first fix: it resets every power setting as a group, including display sleep times and Power Nap choices you made on purpose. Use it only if pmset -g shows other values you cannot explain.

Never appear "away" on Slack again

Cloud-based. No downloads. Works 24/7 even when your laptop is off.

pmset disablesleep vs sleep 0, noidle and caffeinate

CommandAdmin rightsLid closedEnds when
sudo pmset -a disablesleep 1YesStays awakeYou run disablesleep 0
sudo pmset -a sleep 0YesSleepsYou set a sleep time again
pmset noidleNoSleepsYou press Ctrl-C
caffeinate -iNoSleepsThe command or timer ends

  • • pmset sleep 0 sets the idle sleep timer to never. It is in the manual ("0 to disable"), but it only stops idle sleep. Closing the lid still puts the Mac to sleep. Use -c instead of -a to apply it on the charger only.
  • • pmset noidle holds an assertion while it runs and needs no admin rights. We ran it on macOS 26.5.2 and pmset -g assertions showed pid 49529(pmset): NoIdleSleepAssertion named: "pmset prevent sleep" until we stopped it. caffeinate -i -t 4 showed up the same way, as PreventUserIdleSystemSleep named: "caffeinate command-line tool", for 4 seconds. The manual marks it deprecated in favor of caffeinate.
  • • caffeinate is the supported tool for keeping the Mac awake for one job or one stretch of time, and it ends by itself. Every flag, with timers and examples, is in caffeinate on Mac.
  • Only disablesleep covers a closed lid with no external display. With a display, keyboard and power connected, macOS supports lid-closed use on its own (clamshell mode), and that needs no command. Both setups are compared in how to keep a laptop awake with the lid closed.

    When to use it, and the risks

    disablesleep fits a Mac that has to keep a download, a render, a backup or a server running with the lid shut and no display attached. For everything else a timed command or an app is safer.

  • • Heat. A closed MacBook that keeps working in a bag or on a bed has little airflow. Keep it on a hard surface.
  • • Battery. The setting also applies on battery, so a closed Mac can run until the battery is empty.
  • • Forgetting. There is no indicator. Put the undo command in the same terminal line as the job: sudo pmset -a disablesleep 1; ./long-job.sh; sudo pmset -a disablesleep 0.
  • • Undocumented. Apple does not list disablesleep in pmset(1), so a macOS update could change it without notice.
  • If you want a menu bar switch instead of Terminal, Amphetamine has a closed-display mode with its own helper. How it compares with KeepingYouAwake is in KeepingYouAwake vs Amphetamine, and the wider list is in best app to keep a Mac awake.

    Does disablesleep keep Slack or Teams active?

    No. A Mac that never sleeps still has an idle user. Slack sets you to away after 10 minutes with no keyboard or mouse input, and Teams after about 5 minutes of inactivity, whatever the power settings say. The same test for the popular apps is in does Amphetamine keep Slack active, and the options that do work on a Mac are in keep Slack active on Mac.

    FAQ

    Can I check disablesleep without sudo? Yes. Run ioreg -r -c IOPMrootDomain | grep SleepDisabled. Yes means sleep is disabled, No means normal sleep.

    Does disablesleep stop the screen from turning off? No. The display still sleeps on its displaysleep timer and the screen still locks. Only system sleep stops.

    Always Active

    Stop Jiggling Your Mouse.

    Join hundreds of remote workers who never worry about their Slack status. Set it up once, stay green forever.

    Related Articles

    Guide

    How to See All Your DMs in Slack, Including the Hidden Ones

    The DMs tab lists your direct messages with people. App DMs, Slackbot and DMs with deleted accounts sit elsewhere. We compared the tab with the full list the Slack API returned.

    Slack Green Team
    Guide

    Slack Images Not Showing? 5 Causes We Reproduced

    We uploaded images to a Slack test channel and then switched each image setting off, ran /collapse, and posted from a bot that was not in the channel. Five causes, each reproduced.

    Slack Green Team
    Guide

    How to Message Yourself on Slack (and What It Notifies)

    Your own name under Direct messages opens a private DM with yourself. We sent it a note, a file, a scheduled message and a reminder, and checked which ones raised a badge.

    Slack Green Team