You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected file named "nul" is repeatedly created after updating OpenCode #11403
After updating to the latest version of OpenCode, I’m seeing an unexpected file named nul being created in my working directory.
-rw-rw-r-- 1 jim jim 29 Jan 31 03:52 nul
This file keeps appearing even though I did not create it manually.
Plugins
oh-my-opencode
OpenCode version
v1.1.47
Steps to reproduce
No response
Screenshot and/or share link
Operating System
Ubuntu-24.04
Terminal
Windows Terminal
Reacted by David Rodrigues, Oleksii Maryshchenko, muoi, JSCOP, 조효재 (Hyojae Cho), Gian P., HiddenDude, emericcolombe, Johan Stenberg, Bjørn Mølgård Vester and 1 more
This issue might be a duplicate of existing issues. Please check:
Crash Report: Bash syntax (=) leaking into PowerShell execution causes CommandNotFoundException #11330: Crash Report: Bash syntax (=) leaking into PowerShell execution causes CommandNotFoundException - This issue discusses the exact same 'nul' file creation problem as a symptom of incorrect Bash syntax being passed to PowerShell on Windows. The root cause appears to be redirection syntax incompatibility (e.g., > /dev/null or incorrect > redirection in PowerShell context).
Feel free to ignore if your specific case differs from this one.
Thanks for the reference. I’ve checked #11330, but I believe my case is different.
The linked issue appears to be Windows-specific and related to Bash redirection syntax leaking into PowerShell execution (nul being created as a side effect on Windows).
In my case, this is happening on Linux (Ubuntu Server), accessed via SSH, with no PowerShell involved.
The nul file is created directly on an ext4 filesystem after running the latest OpenCode version.
Because nul is a Windows-specific device name, seeing it created as a regular file on Linux suggests a different cross-platform handling issue rather than the PowerShell redirection problem described in #11330.
Happy to provide additional logs or a minimal repro if needed.
this seriously needs fixing. opencode created a "nul" file in my workspace root, which can't be removed. its automatically recreated after deletion in explorer even without opencode running..?
The nul file that get created are very annoying. They interfere with my Git workflow — I can't stage all files at once and have to stage them one by one to avoid the nul file. On top of that, the nul file can only be deleted via cmd.
I submitted PR #15183 that fixes this issue for POSIX systems (Linux/macOS). It prevents the literal nul file creation during shell tool execution by sanitizing the redirect target.
This issue has been open since January and continues to affect users across platforms (Linux, Windows, Desktop app) as recently as today. Could someone on the team review and merge the fix?
Thanks!
Reacted by Ali Farahat, lyrisk216, Alpay Yildiray and Joshua-Vogwell-aurora
Activity
github-actions commentedon Jan 31, 2026
This issue might be a duplicate of existing issues. Please check:
> /dev/nullor incorrect>redirection in PowerShell context).Feel free to ignore if your specific case differs from this one.
cyberprophet commentedon Jan 31, 2026
Thanks for the reference. I’ve checked #11330, but I believe my case is different.
The linked issue appears to be Windows-specific and related to Bash redirection syntax leaking into PowerShell execution (nul being created as a side effect on Windows).
In my case, this is happening on Linux (Ubuntu Server), accessed via SSH, with no PowerShell involved.
The nul file is created directly on an ext4 filesystem after running the latest OpenCode version.
Because nul is a Windows-specific device name, seeing it created as a regular file on Linux suggests a different cross-platform handling issue rather than the PowerShell redirection problem described in #11330.
Happy to provide additional logs or a minimal repro if needed.
JSCOP commentedon Feb 25, 2026
Why this issue not start to resolve?
cyberprophet commentedon Feb 26, 2026
I also hope this gets resolved as soon as possible.
phate7 commentedon Mar 9, 2026
Still happening from time to time.
tppawelgrzesik commentedon Mar 19, 2026
Still happening on OpenCode Desktop
v1.2.27 on Windows 11 all the time
HiddenDude commentedon Mar 19, 2026
this seriously needs fixing. opencode created a "nul" file in my workspace root, which can't be removed. its automatically recreated after deletion in explorer even without opencode running..?
sSANATGAR commentedon Mar 20, 2026
Using OpenCode v1.2.27 on Windows (PowerShell).
The nul file that get created are very annoying. They interfere with my Git workflow — I can't stage all files at once and have to stage them one by one to avoid the nul file. On top of that, the nul file can only be deleted via cmd.
Please fix this.
filadog commentedon Mar 27, 2026
bump, still happening, on windows cli version with powershell
dakujem commentedon Mar 31, 2026
The desktop version too. Not sure if it is related to the model, I'm using mostly Sonnet model.
cyberprophet commentedon Mar 31, 2026
Hi maintainers,
I submitted PR #15183 that fixes this issue for POSIX systems (Linux/macOS). It prevents the literal
nulfile creation during shell tool execution by sanitizing the redirect target.This issue has been open since January and continues to affect users across platforms (Linux, Windows, Desktop app) as recently as today. Could someone on the team review and merge the fix?
Thanks!
countzero commentedon Apr 21, 2026
Still happening on windows please fix.
alexbeewise commentedon May 10, 2026
The key breakthrough: ProcMon
The entire root cause analysis was done with AI's help, but the most important debugging tool was:
Sysinternals Process Monitor (ProcMon)
Instead of guessing whether the problem came from:
I used ProcMon to identify the exact process creating the file.
ProcMon setup
Ctrl+X)Ctrl+E)ProcMon immediately showed:
That narrowed the problem down instantly.
Root cause
After tracing the SSH configuration with:
I discovered this bad configuration:
That line caused
ssh.exeto create a literalNULfile in the repo working directory when GitHub fetches or IDE Git integrations executed SSH commands.Git then failed because
NULis a reserved Windows filename.Correct fix
I fixed the SSH config by removing the problematic global configuration and replacing it with properly scoped SSH rules.
After that:
NULstopped appearinggit add .worked normally againImportant lesson
If random files appear in your repo or working directory:
CreateFileWithout ProcMon this could easily turn into hours of blind guessing.
@cyberprophet
github-actions commentedon Jul 10, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.