Agent output getting truncated in the middle of the terminal scrollback
Open 💬 9 comments Opened May 28, 2026 by cowwoc
Problem statement
While reading assistant output in the terminal, entire lines can disappear from the middle of previously rendered output.
Observed user workflow:
- Start at the latest assistant message.
- Scroll upward to earlier output.
- One or more complete lines are missing in terminal history.
- Missing lines are still present in transaction/log view.
The original reporter also observes this in Windows Terminal without tmux.
Repro environment used here
- Linux container environment
- tmux available
- Deterministic harness added under
repro/
Repro script
Run:
./repro/tmux_scrollback_repro.sh
Script behavior:
- Starts a fresh tmux session.
- Emits filler lines.
- Emits numbered stream lines (
S-0001toS-0400) using a Codex-like history insertion escape pattern. - Captures pane history and checks for missing sequence entries.
Expected result
No missing S-#### lines.
Observed result
Deterministic missing middle line in this environment (commonly S-0391).
Example output:
capture_file=/tmp/codex-scroll-repro/capture.txt
missing_file=/tmp/codex-scroll-repro/missing.txt
missing_count=1
missing_examples:
S-0391
Control run
Run:
./repro/tmux_scrollback_repro.sh --plain
Observed control result:
missing_count=0
Attached artifacts
- Repro harness:
repro/tmux_scrollback_repro.sh - Repro notes:
repro/line_truncation_repro.md - Testcase baseline:
codex-rs/tui/tests/suite/vt100_history.rs(incremental_stream_history_keeps_all_numbered_lines)
Direct links are in the issue comments.
Related issues
This issue might be related to #15380.
9 Comments
Attaching the exact repro artifacts here so maintainers can pull/run them directly.
Source commit (fork):
efc6a6fon branchrepro/issue-15380-line-truncation1) Repro harness script
2) Repro documentation
3) Testcase change
If preferred, I can also paste a single patch file in this issue thread.
I packaged this repro shape into a
trace-to-skill@0.1.65demo/report checklist so future scrollback truncation reports can include the same evidence fields instead of only screenshots:The detector keys on the useful details from this thread/class:
tmux_scrollback_repro.sh,missing_count, missing numbered stream lines such asS-0391, the control run, terminal capture, raw transcript/log proof, terminal dimensions/scrollback settings, streaming state, and whether/resumeor transcript mode recovers the missing lines.Not a Codex fix, just a small evidence normalizer for maintainers and reporters.
Release: https://github.com/grnbtqdbyx-create/trace-to-skill/releases/tag/v0.1.65
@fcoury-oai were you able to reproduce the problem using the testcase?
This is just getting worse. Adding the tui alternate_never feels like a slight reduction but not even close to being a fix.
@etraut-openai I can still reproduce this issue on v1.148.0. This is particularly painful because I can't safely scroll back through the terminal history without risking permanent gaps in the output.
The issue is 100% reproducible in my environment, and I've provided a deterministic testcase. Could someone from the Codex team please try running it on your end?
I'd be happy to prepare a PR if you’re open to reviewing and accepting a fix. Please let me know whether that would be useful and where you'd recommend starting.
Potentially related issues: https://github.com/openai/codex/issues/15380, https://github.com/openai/codex/issues/26570, https://github.com/openai/codex/issues/27644, https://github.com/openai/codex/issues/30745
It is a major PITA but in the cli window resizing the window causes the entire contents to be redrawn. At that point I can safely scroll up and view the trashed text.
I tested Codex 0.149.0, which includes PR #39619.
Findings:
missing_count=1, withS-0391missing.missing_count=0.PR #39619 is clearly related because it fixes the Windows Terminal path by avoiding partial DEC scroll regions and preserving scrollback. However, it ultimately did not fix the same problem reproduced here under Linux/tmux. The issue remains reproducible in that environment.
same issue. how is this a freaking thing since may 27
@michael-jennings This issue isn't getting enough visibility. If you want it fixed, try to recruit more users to vote for it.