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: question/ask prompt renders one word per line when model emits carriage returns #36040
When the agent uses the interactive question/ask tool, some model providers emit carriage-return (\r) characters inside the question header, question body, and option label/description. The TUI's opentui renderer treats a bare \r as a hard line break, so the prompt renders with nearly every word on its own line.
What happens
The question and its options become almost unreadable — each word (or CJK segment) wraps to a separate line, e.g.:
定位
换行
问题
TUI
里我输入
/粘贴的文字
instead of:
定位换行问题
TUI 里我输入/粘贴的文字
Root cause
Question strings flow from the model tool call through Question.ask (packages/opencode/src/question/index.ts), which publishes the question.asked event consumed by every render surface:
There is no \r normalization anywhere in this chain. Notably, the user's own prompt textarea already normalizes CRLF (packages/tui/src/component/prompt/index.tsx), but question content coming from the model was never sanitized. The opentui text buffer receives the raw bytes and each \r-separated token wraps to its own line.
Expected
\r characters from model-provided question text should be normalized before the data is stored/broadcast, so the prompt renders normally. Intentional newlines in the multi-line question body should be preserved.
Environment
Reproducible across models that emit \r in tool-call string output.
Affects the TUI most visibly (opentui hard-breaks on \r).
Activity
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.