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
Running Codex inside narrow terminals causes conversation history to be inserted into the scrollback already wrapped to the small width. When the user later widens the terminal (e.g., reconnecting from desktop, or making it full-screen), previously emitted lines remain hard wrapped, so reading old messages is painful
Reproduction
Start Codex in a very narrow terminal (just make it small, or use tmux over mobile SSH works well).
Send/receive a few messages so history is printed into the scrollback.
Resize the terminal wider (or reconnect to tmux from a PC).
Scroll up: older lines keep the original narrow wrapping while new frames render at the new width
Requested Feature
Add some way of redrawing history on resize. May be chat-command, or automatic resize with ~100ms waiting time after resizing is done to not produce flickering.
In my current implementation I've sticked with command one because it's more controllable, but this may be inconvenient to end user. I've already tried automatic resizing, but didn't push the code yet.
Example (using same setup as in reproduction):
Banner about successful resize lives for one second before switching off on any redraw.
Additional information
I don't know if it's really a bug, or missing feature, but i'll be glad to provide PR for any of the implementations.
Reacted by Li Jie, vcombey, andrewfederspiel, bobbywang, Xiao Li, Joshua Soileau, Jacob Y., Jesse Posner, Adrián Molina, tomer-ben-david and 20 more
@Nintorac, you may be interested in this thread. It's not clear that we will be able to address this particular issue. There are many difficult tradeoffs here.
This resolves the terminal corruption reported in a dozen other issues, and the problem is easily fixable. I use this patch every day, can't live without it.
The solution given here works elegantly and perfectly, and doesn't mess up the terminal in any way, works on OSX, Windows, every terminal I've tried it in. Sure, it fills your scrollback, but it resolves the immediate visual artifacts and all the actual grievances raised are moot.
It's not feasible to restart codex every time you resize your terminal. I resize my terminals often.
codex-2026-03-29_01.32.21.1.mp4
I offered this patch before but was rejected because I need to be invited to do a PR. So invite me, tag me, or have someone with better contacts push it.
The claimed desired behavior is for Codex to function like a terminal app. But then it fails to rewrite the input area properly if the window resizes. Sure, rerendering the whole scrollback is excessive, but its a clean and simple patch that I don't foresee anyone complaining about, because they won't notice - because if they log all output to a file, which would be a dumb way to track Codex's work, they're extremely unlikely to resize the window while doing it.
At worst this stays in place and at best this buys time for someone to accommodate all the hundreds of terminal quirks when it comes to cursor movement.
The only people who will notice are the thousands who actually resize their windows and thinks less of OpenAI for not being able to maintain basic terminal hygiene... seeing a messed up terminal really does not inspire confidence in the rest of the codebase.
Running into this consistently when using Codex inside tmux panes. Resizing panes causes history content to disappear — the input area redraws correctly but everything above it gets corrupted.
Traced the root cause to pending_viewport_area() in codex-rs/tui/src/tui.rs (~line 525). When terminal width changes, the terminal emulator reflows scrollback content independently, but the viewport Y position is only adjusted when cursor Y moves. In tmux, the cursor often stays put on width-only resize, so the viewport remains at its stale Y position and overwrites reflowed history.
A minimal fix would be to reposition the viewport to the bottom of the screen on width change:
if screen_size.width != last_known_screen_size.width{let vp_height = terminal.viewport_area.height.min(screen_size.height);returnOk(Some(Rect::new(0,
screen_size.height.saturating_sub(vp_height),
screen_size.width,
vp_height,)));}
But the real fix (as proposed in this issue) is re-rendering the full transcript at the new width, since the history lines were hard-wrapped at the old width and can't reflow.
Both PRs that attempted to fix this (#11896, #12826) were closed due to the contribution policy. Would be great to see the team pick this up — it affects every terminal multiplexer user (tmux, Zellij, tiling WMs).
Can we please get this fixed? I'm facing this issue 24/7 an I'm unable to read codex's replies without always having to hit ctrl+t first to switch to transcript mode which is very annoying to scroll through and shows full transcripts of files read/edited)
I'm getting very bad text corruption with lots of missing lines while using Codex very normally in VS code's terminal:
In normal mode (missing tons of text whle working on a session)
In transcript (virtual scroll mode) the text is shown fine.
@maddada I can't remember seeing any lines disappear spontaneously, recently. If the lines disappear because of terminal size changes, the scrollback rendering will resolve it.
changed the title [-][Feature Request] Allow re-rendering scrollback after terminal resize[/-][+]Rerender scrollback after terminal resize[/+]on Apr 4, 2026
Activity
JoshuaSoileau commentedon Oct 28, 2025
+1 I get this pretty consistently using when using a terminal multiplexer (zellij) resizing terminal panes
Nintorac commentedon Jan 28, 2026
This ticket looks to be related.
#3464
Can we label this a bug? The terminal should be redrawing when geometry changes/when it's foregrounded
etraut-openai commentedon Jan 28, 2026
@Nintorac, you may be interested in this thread. It's not clear that we will be able to address this particular issue. There are many difficult tradeoffs here.
nikhilshinday commentedon Mar 13, 2026
Low-tech solution that solves the problem: close codex and run codex resume, it rerenders correctly!
dagelf commentedon Mar 29, 2026
This resolves the terminal corruption reported in a dozen other issues, and the problem is easily fixable. I use this patch every day, can't live without it.
The solution given here works elegantly and perfectly, and doesn't mess up the terminal in any way, works on OSX, Windows, every terminal I've tried it in. Sure, it fills your scrollback, but it resolves the immediate visual artifacts and all the actual grievances raised are moot.
It's not feasible to restart codex every time you resize your terminal. I resize my terminals often.
codex-2026-03-29_01.32.21.1.mp4
I offered this patch before but was rejected because I need to be invited to do a PR. So invite me, tag me, or have someone with better contacts push it.
The claimed desired behavior is for Codex to function like a terminal app. But then it fails to rewrite the input area properly if the window resizes. Sure, rerendering the whole scrollback is excessive, but its a clean and simple patch that I don't foresee anyone complaining about, because they won't notice - because if they log all output to a file, which would be a dumb way to track Codex's work, they're extremely unlikely to resize the window while doing it.
At worst this stays in place and at best this buys time for someone to accommodate all the hundreds of terminal quirks when it comes to cursor movement.
The only people who will notice are the thousands who actually resize their windows and thinks less of OpenAI for not being able to maintain basic terminal hygiene... seeing a messed up terminal really does not inspire confidence in the rest of the codebase.
dkeysil commentedon Mar 29, 2026
Running into this consistently when using Codex inside tmux panes. Resizing panes causes history content to disappear — the input area redraws correctly but everything above it gets corrupted.
Traced the root cause to
pending_viewport_area()incodex-rs/tui/src/tui.rs(~line 525). When terminal width changes, the terminal emulator reflows scrollback content independently, but the viewport Y position is only adjusted when cursor Y moves. In tmux, the cursor often stays put on width-only resize, so the viewport remains at its stale Y position and overwrites reflowed history.A minimal fix would be to reposition the viewport to the bottom of the screen on width change:
But the real fix (as proposed in this issue) is re-rendering the full transcript at the new width, since the history lines were hard-wrapped at the old width and can't reflow.
Both PRs that attempted to fix this (#11896, #12826) were closed due to the contribution policy. Would be great to see the team pick this up — it affects every terminal multiplexer user (tmux, Zellij, tiling WMs).
maddada commentedon Mar 29, 2026
Can we please get this fixed? I'm facing this issue 24/7 an I'm unable to read codex's replies without always having to hit ctrl+t first to switch to transcript mode which is very annoying to scroll through and shows full transcripts of files read/edited)
I'm getting very bad text corruption with lots of missing lines while using Codex very normally in VS code's terminal:
In normal mode (missing tons of text whle working on a session)
In transcript (virtual scroll mode) the text is shown fine.
dagelf commentedon Mar 29, 2026
@maddada I can't remember seeing any lines disappear spontaneously, recently. If the lines disappear because of terminal size changes, the scrollback rendering will resolve it.
[-][Feature Request] Allow re-rendering scrollback after terminal resize[/-][+]Rerender scrollback after terminal resize[/+]jamesdelevoryas commentedon Apr 20, 2026
Would love this fixed upstream, I've fixed it for personal use in my own copy. Every other coding agent I've used implements this.
petekblaz commentedon Apr 23, 2026
same issue here, since using superset and using a few clis at once, any kind of resizing, or adding new one to the grid messes them up :(
etraut-openai commentedon Apr 28, 2026
This feature will be included in the next release.