Respect terminal width
Resolved 💬 9 comments Opened Aug 8, 2025 by aehlke Closed Dec 31, 2025
💡 Likely answer: A maintainer (easong-openai, contributor)
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?
Resize terminal while running
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
9 Comments
```diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rs
index 86d74141..99bfdff3 100644
--- a/codex-rs/tui/src/app.rs
+++ b/codex-rs/tui/src/app.rs
@@ -496,6 +496,8 @@ impl App<'_> {
}
terminal.draw(|frame| match &mut self.app_state {
AppState::Chat { widget } => {
if let Some((x, y)) = widget.cursor_pos(frame.area()) {
frame.set_cursor_position((x, y));
}
diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs
index 8a47353c..55007cfe 100644
--- a/codex-rs/tui/src/chatwidget.rs
+++ b/codex-rs/tui/src/chatwidget.rs
@@ -110,6 +110,15 @@ fn create_initial_user_message(text: String, image_paths: Vec<PathBuf>) -> Optio
}
impl ChatWidget<'_> {
fn interrupt_running_task(&mut self) {
if self.bottom_pane.is_task_running() {
self.active_history_cell = None;```
Came here to say this also -- the hard wrap at 80 is not pleasant to work with, especially as it cuts words.
@EspenG your patch won't cleanly apply as there have been other changes that mess with the index/diff line number markers.
However, i am testing it and it does make it go full with, which is great... though personally i'd prefer some padding (and also not wrapping/breaking words :/)
I wonder if the @openai folk are intending to use the other part of the width for other content?
We're working on supporting full width with word wrap!
@easong-openai I saw that pr landed and was reverted -- looking forward to seeing how that improves things. :)
_ideally_ it'd be nice if it were possible to set a max width or similar in config - because the output is to be read, it's might be nice not to always have it super wide, without having to change the actual terminal itself.
Agree! I use an iterm hotkey window on a 32 inch monitor and the full-terminal line wrapping is more than a little silly there. I think this is an improvement for enough users that we should add that in a later release.
@easong-openai I was working on a similar PR, but figured I should see if the issue was even open. Very excited to hear!
Curious to see how my work differs when support lands.
Do you plan on doing line-breaks on syllables / phonemes, or just a hard column cutoff like currently?
Just saw this issue. I was fixing the markdown render bug in the Rust CLI and realized that there is overlap with the lack of soft-wrap, so I fixed them both together: https://github.com/openai/codex/pull/2143 😃
This feature hasn't received any upvotes or new posts in a long time, so I'm going to close it out.
We are actively exploring alternative terminal UI update mechanisms that would address this issue, but these alternative approaches have other tradeoffs. There's no solution that will address all terminal-related problems like this.