Skip to content

Fix: notifications broken on Windows (writeFileSync /dev/tty)#12

Open
harryalbert wants to merge 2 commits intomainfrom
harry/app-4096-fix-opencode-tty-output-on-windows
Open

Fix: notifications broken on Windows (writeFileSync /dev/tty)#12
harryalbert wants to merge 2 commits intomainfrom
harry/app-4096-fix-opencode-tty-output-on-windows

Conversation

@harryalbert
Copy link
Copy Markdown
Contributor

@harryalbert harryalbert commented Apr 16, 2026

warpNotify writes the OSC 777 escape sequence via writeFileSync("/dev/tty", ...). /dev/tty is a Unix-only device — it doesn't exist on native Windows (PowerShell, CMD). The catch block silently swallows the error, so no notifications ever reach Warp on Windows. This also means the setup chip never disappears, since Warp never receives a session_start event.

The fix is to fall back to process.stdout.write when the first write attempt fails. This matches the pattern used by OpenCode's own clipboard PR and the opencode-terminal-bell-notifier community plugin

Should fix #11 (I reached out to folks in the issue thread to ask them to confirm)

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@harryalbert harryalbert changed the title fall back to process.stdout.write when writeFileSync fails Fix OpenCode notifications for windows Apr 16, 2026
@harryalbert harryalbert changed the title Fix OpenCode notifications for windows Fix: notifications broken on Windows (writeFileSync /dev/tty) Apr 16, 2026
@harryalbert harryalbert marked this pull request as ready for review April 16, 2026 14:12
@harryalbert harryalbert requested a review from zachbai April 16, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin setup notification never disappears (plugin not recognized as installed)

2 participants