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?

  1. Run a task or request an output using Codex in the terminal.
  2. Wait for the generation to finish without interacting with the terminal, VS Code, or the PC.
  3. Observe the output: it will likely be cut off or contain multiple empty lines.
  4. 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.

View original on GitHub ↗

10 Comments

Kailtis · 5 months ago

Got the same issue on mac with ghostty.
Exiting the session and resuming it brings back the missing stuff, but it's so annoying.

paw-paw · 5 months ago

Another workaround is to press double Esc to edit previous messages, and then scrolling back.

Kailtis · 5 months ago

Seems the new update solved it (on mac at least) ? Haven't had it since updating.

chankeiro · 5 months ago

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.

fcoury contributor · 5 months ago

Possibly related issues: #10901 #12223

sstklen · 4 months ago

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's unmount(), 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.

// In the main CLI entry (e.g. cli.tsx or index.tsx), where Ink render instance is created:
const instance = render(<App />);
await instance.waitUntilExit();
// Drain stdout before exiting to prevent truncation in slow terminals (VSCode, WSL)
await new Promise<void>((resolve) => {
  if (process.stdout.writableEnded) { resolve(); return; }
  process.stdout.write('', () => resolve());
});
process.exit(0);

Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞

_Disclosure: This analysis is from Confucius Debug, an AI-powered community KB for agent bugs. Please verify before applying._

---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>

coleski · 3 months ago

Yeah same issue. Still experiencing it.
Version: v0.120.0
Client: Superset
macOS Version: macOS 15.3.1 (24D70)

runfence · 2 months ago
Temirkul · 2 months ago

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.

mshakeg · 1 month ago

still hasn't been fixed as of 0.133.0 in the vs code integrated terminal