Undeletable nul file #9201

Open
opened 2026-02-16 18:11:53 -05:00 by yindo · 5 comments
Owner

Originally created by @GTonehour on GitHub (Feb 12, 2026).

Originally assigned to: @Hona on GitHub.

Description

Open Code creates a nul file on the root directory of the project. That file can't be deleted on Windows.

Versions where the bug was reported.

  • I personally encountered the bug using v1.1.60 on Windows 11 Pro 25H2...
  • ... and using 1.1.59 on Windows 11 Home 24H2.
  • @harunurhan reported the bug on 1.1.27
  • @rycerzes reported it on 1.1.21 using Windows 11 24H2
  • @Mojobucks reported downgrading from 1.1.15 to 1.1.14 fixed it

Issues mentioning that probelm

Strategies to delete that file...

Plugins

None

OpenCode version

1.1.60

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @GTonehour on GitHub (Feb 12, 2026). Originally assigned to: @Hona on GitHub. ### Description Open Code creates a `nul` file on the root directory of the project. That file can't be deleted on Windows. ## Versions where the bug was reported. - I personally encountered the bug using v1.1.60 on Windows 11 Pro 25H2... - ... and using 1.1.59 on Windows 11 Home 24H2. - @harunurhan [reported](https://github.com/anomalyco/opencode/issues/8108#issuecomment-3778649870) the bug on 1.1.27 - @rycerzes [reported](https://github.com/anomalyco/opencode/issues/8108#issuecomment-3758146304) it on 1.1.21 using Windows 11 24H2 - @Mojobucks [reported](https://github.com/anomalyco/opencode/issues/8108#issuecomment-3741533611) downgrading from 1.1.15 to 1.1.14 fixed it ## Issues mentioning that probelm - https://github.com/anomalyco/opencode/issues/8108 - https://github.com/anomalyco/opencode/issues/10871 ## Strategies to delete that file... - https://github.com/anomalyco/opencode/issues/10871#issuecomment-3808755799: "navigate to the directory via WSL and delete the files" - WinRar "Delete files after archiving" ### Plugins None ### OpenCode version 1.1.60 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal Windows Terminal
yindo added the windowsbug labels 2026-02-16 18:11:53 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 12, 2026):

This issue appears to be a duplicate of existing open issues. Please check:

  • #11403: Unexpected file named "nul" is repeatedly created after updating OpenCode
  • #11586: nul file generate

These issues describe the same problem with the nul file being created and causing issues on Windows. Consider consolidating the discussion there to help maintainers track the fix.

@github-actions[bot] commented on GitHub (Feb 12, 2026): This issue appears to be a duplicate of existing open issues. Please check: - #11403: Unexpected file named "nul" is repeatedly created after updating OpenCode - #11586: nul file generate These issues describe the same problem with the `nul` file being created and causing issues on Windows. Consider consolidating the discussion there to help maintainers track the fix.
Author
Owner

@breggles commented on GitHub (Feb 14, 2026):

Happens for me in OpenCode 1.2.1 on Windows 11. Can't delete in PowerShell, but can delete using File Explorer. Requires admin approval to delete.

@breggles commented on GitHub (Feb 14, 2026): Happens for me in OpenCode 1.2.1 on Windows 11. Can't delete in PowerShell, but can delete using File Explorer. Requires admin approval to delete.
Author
Owner

@breggles commented on GitHub (Feb 14, 2026):

PS: Claude says this: "This is almost certainly being created by OpenCode (or one of its tools) running on Windows. When code written for Unix tries to redirect output to /dev/null, on Windows that can inadvertently create a literal file named nul in the working directory."

@breggles commented on GitHub (Feb 14, 2026): PS: Claude says this: "This is almost certainly being created by OpenCode (or one of its tools) running on Windows. When code written for Unix tries to redirect output to /dev/null, on Windows that can inadvertently create a literal file named nul in the working directory."
Author
Owner

@breggles commented on GitHub (Feb 14, 2026):

...can delete using File Explorer. Requires admin approval to delete.

Scratch that, it just appears to delete it, but when i hit it F5 it's there again. So either it didn't actually get deleted, or it got re-created immediately? 🤔

@breggles commented on GitHub (Feb 14, 2026): > ...can delete using File Explorer. Requires admin approval to delete. Scratch that, it just appears to delete it, but when i hit it F5 it's there again. So either it didn't actually get deleted, or it got re-created immediately? 🤔
Author
Owner

@breggles commented on GitHub (Feb 14, 2026):

Oh, there is a fix. Ignore me...

@breggles commented on GitHub (Feb 14, 2026): Oh, there is a fix. Ignore me...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9201