Codex CLI in vscode terminal cuts chunks of final output when it finishes
Open 💬 10 comments Opened Feb 9, 2026 by danicatalan00
💡 Likely answer: A maintainer (fcoury, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
codex-cli 0.98.0
What subscription do you have?
ChatGPT Plus
Which model were you using?
gpt-5.3-codex
What platform is your computer?
wsl ubuntu, ubuntu: Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64, windows host: Microsoft Windows NT 10.0.22631.0 x64
What terminal emulator and version are you using (if applicable)?
VSCode
What issue are you seeing?
The final output is consistently incomplete ("missing chunks") and contains an excessive amount of blank printed lines. This behavior appears to be independent of the task's length or complexity. Although it initially seemed related to UI interactions (like resizing the terminal or the VS Code window), the issue persists even when the computer is left untouched during the output generation.
What steps can reproduce the bug?
- Run a task or request an output using Codex in the terminal.
- Wait for the generation to finish without interacting with the terminal, VS Code, or the PC.
- Observe the output: it will likely be cut off or contain multiple empty lines.
- Current workaround: Quit Codex and run codex resume [session-hash]. This consistently provides the full, correct output without cuts.
What is the expected behavior?
The output should be printed completely and with correct formatting (no unnecessary blank lines) in a single run, without requiring a session resume.
Additional information
- The issue occurs approximately 90% of the time.
- The problem persists regardless of whether the terminal or VS Code window is resized during the process.
- I am primarily noticing this in the VS Code integrated terminal, which is my daily driver. I haven't been able to confirm if this is a general CLI issue or specific to the VS Code terminal environment.
- I have tried not giving any input to the PC during "Codex's turn" to avoid messing with the line printing, but the result is the same.
- It feels like a regression or a bug that might need a fix in a future update.
10 Comments
Got the same issue on mac with ghostty.
Exiting the session and resuming it brings back the missing stuff, but it's so annoying.
Another workaround is to press double Esc to edit previous messages, and then scrolling back.
Seems the new update solved it (on mac at least) ? Haven't had it since updating.
MacOS user here. The issue persists in v0.99.0.
Example: This is the output seen in the Transcript View (double ESC):
<img width="1669" height="154" alt="Image" src="https://github.com/user-attachments/assets/1815e1c0-bf09-41b3-9d8c-9961a5dbde4c" />
And this is what I see in the regular terminal view:
<img width="1578" height="168" alt="Image" src="https://github.com/user-attachments/assets/5761cc5f-3d83-4b7b-9460-da289874b5ce" />
I've just seen v0.101.0 has been released. I'll check if it still happens in this new version.
Possibly related issues: #10901 #12223
Hey! I ran into a similar pattern in our bug knowledge base and thought this might help.
What's happening: Ink (React terminal UI) render loop is async and batches stdout writes. When Codex CLI finishes a task, the process exits or Ink unmounts before the final render frames are flushed to stdout. VSCode's integrated terminal has higher latency than native terminals, making the race window wider and the truncation more visible. The 'missing chunks' are queued Ink frames that never get written because Node's stdout buffer is abandoned on exit.
What worked for us:
Await Ink's waitUntilExit() and explicitly drain stdout before process.exit(). In the CLI entry point, replace any early exit with:
await inkInstance.waitUntilExit(); await new Promise(r => process.stdout.write('', r)); process.exit(0);. If using Ink'sunmount(), call it and then await the stdout drain. For users on 0.98.0: update to latest codex-cli which reportedly fixes this, or as workaround press Esc twice then scroll back to see full output.Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞
---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>
Yeah same issue. Still experiencing it.
Version: v0.120.0
Client: Superset
macOS Version: macOS 15.3.1 (24D70)
Seems to be similar to https://github.com/openai/codex/issues/5538
it's crazy that this still isn't fixed. Running in vscode terminal codex version v0.130.0
How come, openai? Really? This is so annoying, it literally makes codex cli almost unusable.
still hasn't been fixed as of 0.133.0 in the vs code integrated terminal