Rust TUI clips message instead of wrapping or providing horizontal scroll
Resolved 💬 2 comments Opened May 8, 2025 by bolinfest Closed May 19, 2025
💡 Likely answer: A maintainer (bolinfest, collaborator)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
_No response_
Which model were you using?
_No response_
What platform is your computer?
_No response_
What steps can reproduce the bug?
Have a conversation in the Rust TUI that causes lines longer than the viewable width. The content is clipped and the only way to see it is to make your terminal window wider.
What is the expected behavior?
Ideally, the content would wrap, but not in a way that breaks scrolling.
What do you see instead?
_No response_
Additional information
https://github.com/openai/codex/pull/868 fixed scrolling but broke wrapping.
2 Comments
Thinking about this more, I think the problem is mainly when
scroll_positionisusize::MAX(i.e., keep the scroll pinned to the bottom as new events come in). In that mode, we walk backwards from the end of the list of lines to compute the "visible lines":https://github.com/openai/codex/blob/27198bfe11bd1f909c9ed0b17f923b04b53c2785/codex-rs/tui/src/conversation_history_widget.rs#L346-L354
Consider a scenario where:
If any of lines 91-99 wrap, then line 100 would get pushed below the fold and the user would not be able to scroll to it because
ConversationHistoryWidgetalready thinks it is scrolled all the way to the bottom.Fixed in https://github.com/openai/codex/pull/937
Though some additional cleanup in https://github.com/openai/codex/pull/989