Skip to content

a weird nul file #15480

@Loulou823

Description

@Loulou823

Description

🐞 Bug: OpenCode creates nul file on Windows (Reserved device name)

Environment

  • OS: Windows 11 25H2
  • Node.js: v24.13.1
  • npm: v11.8.0

Description

When executing certain OpenCode commands on Windows, a file named:

nul

is created in the project directory.

On Windows, NUL is a reserved DOS device name (null device) and should not exist as a normal filesystem file. Once created, it cannot be deleted using standard methods such as:

del nul

This causes issues with Git, editors, and project tooling.


Expected Behavior

OpenCode should not create files using reserved Windows device names.

No nul file should appear in the working directory.


Actual Behavior

  • A file named nul appears in the project root.
  • It cannot be deleted normally.
  • It may require forced deletion using the device namespace path:

del .\C:\path\to\project\nul


Possible Cause

This may be related to:

  • Improper stdout/stderr redirection (> nul)
  • A dependency writing to "nul" as a filename
  • Cross-platform handling assuming /dev/null
  • Windows-specific path handling bug

Reproduction Steps

some times

Plugins

none

OpenCode version

1.2.15

Steps to reproduce

some times

Screenshot and/or share link

No response

Operating System

Windows 11 25H2

Terminal

Windows CMD

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions