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
TUI shows blank page when ~/Library contains large number of files #27071
TUI always shows a completely blank page after launch. Backend (opencode serve) works correctly with proper API responses. The issue persists across ALL terminal emulators.
Root Cause
Bun runtime scans ~/Library directory during initialization. My ~/Library contains millions of files (WPS Office PDF caches, Claude session data, JetBrains caches, etc.) with paths up to 453 characters long. This scanning blocks the TUI rendering thread, resulting in a blank page.
Colleagues with identical hardware/software do NOT have this issue — their ~/Library directories have far fewer files.
Reproduction
Have a macOS system with a large ~/Library directory (millions of files)
Run opencode in any terminal
Observe blank TUI
Backend logs show 3x ENAMETOOLONG: name too long, open rejection
Workaround
Set HOME to a minimal isolated directory before launching:
export HOME="/path/to/minimal/home"
opencode
Log Evidence
INFO service=file.watcher init
ERROR service=default e=ENAMETOOLONG: name too long, open rejection
ERROR service=default e=ENAMETOOLONG: name too long, open rejection
ERROR service=default e=ENAMETOOLONG: name too long, open rejection
ERROR service=default e=EIO: i/o error, read exception
ERROR service=default e=setRawMode failed with errno: 9 exception
Suggested Fix
Avoid scanning ~/Library during TUI initialization
Add timeout for file scanning operations to prevent blocking the render loop
Handle ENAMETOOLONG gracefully instead of crashing TUI
Hit the same blank TUI on a fresh Homebrew install (anomalyco/tap/opencode 1.17.17).
Environment
OS: macOS 26.5.2 (Darwin 25.5.0, arm64)
Install: Homebrew (/opt/homebrew/bin/opencode)
Terminal: standard macOS terminal (also reproducible in non-TTY environments)
Symptoms
Running opencode → blank screen, no UI, appears hung
opencode run and TUI mode hang at init in logs
opencode serve starts fine (headless works)
opencode models, opencode debug config work without full instance init
~/Library size
~45 GB and ~650k files when the bug occurred
After cleanup (removed Android SDK, unused app data, etc.) still ~27 GB — issue was present before and after cleanup
Logs
Logs stop at init, then (when run with a PTY) ENAMETOOLONG: name too long, open during directory walk — consistent with file watcher / home-dir scanning blocking startup.
Workaround (confirmed working)
Launch with a minimal HOME and symlink real config/data paths:
Activity
github-actions commentedon May 12, 2026
This issue might be a duplicate of existing issues. Please check:
ENAMETOOLONGerrors from file.watcher scanning large directories causing blank TUI (also filed by the same author; consider consolidating)setRawMode failed with errno: 9,EIO: i/o error, blank TUI on macOS)setRawMode failed with errno: 9blank screen issue on macOSsachanritik1 commentedon Jul 9, 2026
Additional report (macOS 26.5, opencode 1.17.17)
Hit the same blank TUI on a fresh Homebrew install (
anomalyco/tap/opencode1.17.17).Environment
/opt/homebrew/bin/opencode)Symptoms
opencode→ blank screen, no UI, appears hungopencode runand TUI mode hang atinitin logsopencode servestarts fine (headless works)opencode models,opencode debug configwork without full instance init~/LibrarysizeLogs
Logs stop at
init, then (when run with a PTY)ENAMETOOLONG: name too long, openduring directory walk — consistent with file watcher / home-dir scanning blocking startup.Workaround (confirmed working)
Launch with a minimal
HOMEand symlink real config/data paths:With this wrapper, TUI starts normally and
opencode runcompletes successfully.What did NOT help
OPENCODE_DISABLE_DEFAULT_PLUGINS=1OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true~/.cache/opencodeand~/.local/share/opencode--pureflagHappy to provide more logs or test a fix build if useful.
github-actions commentedon Sep 8, 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.