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
Bug: Paste + Enter causes text to disappear without sending #31246
When pasting text into the chat input and pressing Enter, the pasted text disappears instead of being sent. Typing normally (without pasting) works fine.
Steps to Reproduce
Copy any text
Paste it into the chat input
Press Enter immediately after pasting
The text vanishes
Root Cause
contenteditable div race condition: paste event and keydown (Enter) fire in parallel, DOM not updated yet when Enter checks for content, submit aborted.
Environment
-OpenCode 1.16.2 (npm: opencode-ai)
-Kubuntu Linux, KDE Konsole
Suggested Fix
-Read DOM directly on Enter instead of stale state
-Add isPasting flag
-Use requestAnimationFrame before content check
If your issue is distinct (specifically triggered by pressing Enter immediately after paste, rather than typing after paste), please add a note clarifying the difference so maintainers can track it separately.
This may be fixed in v1.18.4 by #37483, which changed paste handling to synchronously insert plain text and update prompt state. Could you test on v1.18.4 and confirm whether paste followed immediately by Enter now sends correctly?
Activity
github-actions commentedon Jun 7, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct (specifically triggered by pressing Enter immediately after paste, rather than typing after paste), please add a note clarifying the difference so maintainers can track it separately.
opencode-agent commentedon Jul 20, 2026
This may be fixed in v1.18.4 by #37483, which changed paste handling to synchronously insert plain text and update prompt state. Could you test on v1.18.4 and confirm whether paste followed immediately by Enter now sends correctly?
github-actions commentedon Sep 19, 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.