Prevent sleep during downloads, renders and presentations

Long tasks fail in two ways: the computer sleeps and the job stops, or the screen goes dark while you need it. They need different fixes.

Last reviewed: November 2, 2026

Job running vs screen on

A download, render, backup, build or AI coding agent needs the system to stay awake; the screen can turn off. A presentation, dashboard, recipe, sheet music or reading needs the display on; the computer is in use anyway.

A browser wake lock only covers the display[1]. It is ideal for the second group and not a guarantee for the first.

Checklist for long jobs

  1. Plug in the laptop. Many sleep and battery rules are stricter on battery.
  2. Prevent system sleep for the duration: on Mac, run the job through caffeinate, for example caffeinate -i followed by the command, or caffeinate -w with the process ID[2]; on Windows, use PowerToys Awake with a time interval[3] or raise “Make my device sleep after” while plugged in[4].
  3. Keep the lid open, or use closed-display mode on a Mac with power, an external display, keyboard and mouse[5].
  4. Check that something is really holding the system awake: powercfg /requests on Windows[6].
  5. Restore normal settings when done, or use a method with a built-in end time.

Agents and builds that run in a terminal on Mac can simply be started as caffeinate -i <command>: the Mac stays awake exactly as long as the command runs.

Checklist for screen-on tasks

  • Presentations and slideshows: presentation apps in slideshow mode often keep the display on; on Windows you can confirm it with powercfg /requests. If yours does not, start the keep-awake tool in a visible window or disable the screen saver for the session (Windows).
  • Dashboards and digital signage: use a dedicated window with the browser tool and a plugged-in device; for permanent displays, set the power settings accordingly.
  • Recipes, sheet music, online classes, reading: the browser tool on a phone, tablet or laptop, with auto-stop so the screen does not stay on all night.
  • Second monitor: put the tab on the monitor you want to keep lit and keep it visible there. How other connected monitors behave depends on the system, so test once before relying on it.

Long tasks inside a browser

Uploads and web apps running in a tab also stop if the computer sleeps. Keep the tab visible with a wake lock and prevent system sleep as above. Background tabs can be slowed down by the browser to save power, so keep important tabs in their own window.

If it still goes to sleep

Look at the troubleshooting guide for screen and browser problems, and at the Windows and Mac guides for system settings that may override your tool.

Frequently asked questions

Will my download continue if the screen turns off?

Yes, as long as the computer does not go to sleep. Screen off and sleep are separate timers.

How do I keep my Mac awake overnight for an AI agent or build?

Plug it in, keep the lid open, and start the job with caffeinate -i in front of the command.

Sources

Official documentation consulted when writing this page. Menus and defaults change between versions, so check the current documentation for your version.

  1. Screen Wake Lock API — MDN Web Docs
  2. caffeinate (man page copy, unofficial) — SS64
  3. PowerToys Awake utility for Windows — Microsoft Learn
  4. How to adjust power and sleep settings in Windows — Microsoft Support
  5. Use your Mac notebook computer in closed-display mode — Apple Support
  6. Powercfg command-line options — Microsoft Learn