How to Fix “The Window Has Crashed” Error in VS Code on Windows 11

Visual Studio Code (VS Code) is one of the most popular code editors in the world — loved by developers for its speed, flexibility, and extensive extension ecosystem. However, like any other app, it’s not immune to crashes.

If you’re seeing the “The window has crashed” message in VS Code on Windows 11, don’t worry — you’re not alone. This usually happens when the editor’s rendering process or extensions malfunction.

In this guide, we’ll walk you through the causes of this error and step-by-step solutions to fix it permanently on your Windows 11 PC.

Why “The Window Has Crashed” Error Appears in VS Code

Several factors can cause VS Code to crash or fail to open properly. Here are the most common:

  • Hardware acceleration conflicts (GPU issues)
  • Corrupted user settings or cache
  • Faulty or incompatible extensions
  • Outdated VS Code version
  • System-level conflicts (graphics driver or OS bugs)

Understanding the cause helps you choose the right fix below.

1. Restart Visual Studio Code

Sometimes, the crash is temporary and related to a one-time rendering glitch.

  1. Close all instances of VS Code.
  2. Press Ctrl + Shift + Esc to open Task Manager.
  3. Under the Processes tab, look for Code.exe.
  4. Select it and click End Task.
  5. Restart VS Code again.

Pro Tip: If you had multiple projects open, VS Code might crash trying to restore all windows at once. Try launching it with the –disable-restore-windows flag (explained later).

2. Launch VS Code Without Extensions

Faulty or outdated extensions are the most common reason for the “The window has crashed” error.

  1. Press Windows + R to open Run.
  2. Type: code --disable-extensions
  3. Press Enter.

If VS Code opens successfully, that means one or more extensions are crashing the editor.

Fix:

  • Open the Extensions sidebar (Ctrl + Shift + X).
  • Disable or uninstall suspicious or recently installed extensions.
  • Restart VS Code normally.

3. Disable Hardware Acceleration

Hardware acceleration uses your GPU to render VS Code faster, but it can cause crashes on certain graphics drivers or integrated GPUs.

  1. Press Windows + R.
  2. Type: code --disable-gpu
  3. Press Enter to launch VS Code with GPU acceleration disabled.

If this fixes the crash, make the change permanent:

Permanent Fix:

  1. Open your VS Code Settings (JSON) file.
  2. Add this line: "disable-hardware-acceleration": true
  3. Save the file and restart VS Code.

Now VS Code will launch without GPU acceleration automatically.

4. Delete VS Code Cache and Temporary Data

Corrupted cache or workspace storage can also trigger startup crashes.

  1. Close VS Code completely.
  2. Press Windows + R, then type: %AppData%\Code
  3. Press Enter and delete these folders (if they exist):
    • Cache
    • CachedData
    • CachedExtensions
    • GPUCache
  4. Next, open: %UserProfile%\.vscode Delete the workspaceStorage folder.
  5. Restart VS Code.

Note: This won’t delete your projects or settings — it only resets temporary data.

5. Reset VS Code User Settings

Sometimes, conflicting configuration settings can cause crashes. Resetting VS Code to default settings can help.

  1. Close VS Code.
  2. Press Windows + R and enter: %AppData%\Code\User
  3. Delete the settings.json file.
  4. Restart VS Code — it will recreate this file automatically with default settings.

Pro Tip: You can back up your current settings first by copying the file to another folder.

6. Run VS Code as Administrator

In some cases, VS Code may crash because it doesn’t have the necessary permissions to read or write workspace data.

  1. Right-click on the VS Code shortcut.
  2. Select Run as administrator.
  3. If it opens normally, right-click the shortcut again → Properties → Compatibility tab → Check “Run this program as an administrator” → Apply → OK.

7. Reinstall or Update Visual Studio Code

If your installation is corrupted, reinstalling or updating VS Code can resolve persistent crashes.

  1. Press Windows + I → Apps → Installed apps.
  2. Search for Visual Studio Code.
  3. Click the three dots (⋯)Uninstall.
  4. Once uninstalled, download the latest version from: https://code.visualstudio.com/
  5. Install VS Code again and open it.

Tip: During reinstallation, avoid restoring extensions automatically to ensure a clean start.

8. Update Your Graphics Drivers

Outdated or incompatible GPU drivers can cause rendering issues with hardware acceleration.

  1. Press Windows + X → Device Manager.
  2. Expand Display adapters.
  3. Right-click your graphics card → Update driver.
  4. Choose Search automatically for drivers.
  5. Once updated, restart your PC.

Alternatively, visit your GPU manufacturer’s website (NVIDIA, AMD, Intel) for the latest driver version.

9. Run VS Code in Compatibility Mode

If you’re using certain Windows 11 builds, VS Code might not behave correctly.

  1. Right-click Visual Studio Code → Properties → Compatibility tab.
  2. Check Run this program in compatibility mode for:
    • Select Windows 10.
  3. Click Apply → OK.
  4. Reopen VS Code.

10. Repair System Files Using SFC and DISM

If VS Code still crashes, corrupted system files could be the underlying cause.

  1. Open Command Prompt (Admin).
  2. Run the following commands one by one: sfc /scannow Wait for it to complete, then run:
    DISM /Online /Cleanup-Image /RestoreHealth
  3. Restart your computer.

Why this works: These tools repair missing or damaged Windows components that might interfere with app stability.

Wrapping Up

If you’re seeing the “The window has crashed” error in Visual Studio Code on Windows 11, the most likely causes are faulty extensions, GPU rendering conflicts, or corrupted cache files.

Start by launching VS Code with --disable-extensions or --disable-gpu, clear cached data, and if needed, reinstall VS Code or update your graphics drivers.

With these steps, your editor should open smoothly again — letting you get back to what matters most: coding productively.

Posted by Arpita

With a background in Computer Science, she is passionate about sharing practical programming tips and tech know-how. From writing clean code to solving everyday tech problems, she breaks down complex topics into approachable guides that help others learn and grow.