Output capture fails for Node.js scripts after GitHub restore (Windows PowerShell)

Why closing and reloading the project folder worked

The issue was corrupted workspace-level state in the IDE, not the files or Git state.

The difference between methods

  1. Reload Window (Ctrl+Shift+P > “Reload Window”):
  • Reloads the window UI and extensions

  • Keeps workspace state in memory (file watchers, output stream handlers, workspace caches)

  • The corrupted workspace state persisted through the reload

  1. Full Restart (closing Cursor completely):
  • Clears everything, but may reload workspace state from disk cache

  • Slower and may not address workspace-specific corruption

  1. Close Folder (File > Close Folder) — what worked:
  • Unloads the workspace from memory

  • Clears workspace state, file watchers, output stream handlers, and workspace-specific caches

  • Forces a fresh workspace initialization when reopened

  • Faster than a full restart and targets the problem area

Why this matters

After GitHub restore, the IDE’s workspace state can become corrupted:

  • Output stream handlers may have incorrect file descriptors

  • File watchers may have stale references

  • Workspace process execution context may have cached incorrect metadata

Reload Window didn’t fix it because it keeps workspace state in memory. Close Folder fixed it by clearing that state and rebuilding it from scratch.