Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>No SleepNew to Visual Studio Code? Get it now.
No Sleep

No Sleep

Yan Wang

|
29 installs
| (0) | Free
Prevents system sleep while VS Code is active
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Keep Awake 🔌

Prevent system sleep/idle while Visual Studio Code is active

Features

  • 🛡️ Automatic sleep prevention when VS Code is running
  • 🖥️ Cross-platform support (Windows, macOS, Linux)
  • 🔋 Power-aware - Stops when VS Code closes
  • ⚙️ Zero configuration required
  • 🚫 No admin privileges needed

Supported Methods

Platform Method
Windows Simulate F15 key every 55s
macOS Native caffeinate utility
Linux systemd-inhibit or xdg-reset

Usage

The extension works automatically after installation. You'll see a status bar notification when active.

Requirements

  • VS Code 1.98.2+
  • System Requirements:
    • Windows: PowerShell 5.1+
    • macOS: Built-in utilities
    • Linux: systemd-inhibit or xdg-screensaver

Troubleshooting

If sleep prevention isn't working:

  1. Check VS Code's Output panel (View > Output)
  2. Select "No Sleep" from the dropdown
  3. Look for error messages

Common solutions:

# Linux systems may require:
sudo apt install xdg-utils  # Debian/Ubuntu
sudo yum install xdg-utils  # RHEL/CentOS

FAQ

❓ Does this affect battery life?
Yes - prevents system sleep, which may increase power consumption.

❓ Can I disable it temporarily?
No

❓ Is this safe?
Absolutely! No elevated permissions required.

Acknowledgements

  • VS Code Extension API documentation
  • Apple caffeinate team
  • Linux systemd contributors

Happy coding without interruptions! 🚀

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft