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
fix(tui): prevent whitespace-only prompt from being submitted #32631
The TUI prompt can be submitted when it contains only whitespace (spaces, tabs, newlines), which sends an effectively empty message to the session.
Root Cause
In packages/tui/src/component/prompt/index.tsx, the submit guard checks:
if(!store.prompt.input)returnfalse
This only blocks a completely empty string. A string of whitespace characters (" ", "\t", etc.) is truthy and passes the check, resulting in a blank user message being sent.
Fix
Change the guard to trim whitespace before checking:
if(!store.prompt.input.trim())returnfalse
The trimmed value is already computed two lines below for command detection, so this is a minimal, safe change.
Steps to Reproduce
Open the TUI.
Type one or more spaces in the prompt.
Press Enter.
Observe that a blank user message bubble appears and the session receives an empty prompt.
Expected Behavior
Pressing Enter on a whitespace-only prompt should do nothing (same behavior as an empty prompt).
Activity
github-actions commentedon Jun 17, 2026
This issue might be a duplicate of existing issues. Please check:
fix(tui): prevent whitespace-only prompt from being submitted
github-actions commentedon Aug 17, 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.