Codex doesn't work properly after resuming from being sent to suspend

Resolved 💬 12 comments Opened Jun 5, 2026 by LC43 Closed Jun 16, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.137.0

What subscription do you have?

Go

Which model were you using?

gpt-5.5

What platform is your computer?

Linux 7.0.0-22-generic x86_64 ubuntu 26 Lts

What terminal emulator and version are you using (if applicable)?

gnome terminal, kitty

Codex doctor report

What issue are you seeing?

When I login to a machine and start codex, I often need to check something on the terminal. i send suspend to send codex to the background. when i bring it to the foreground it comes unresponsive or just broken unprocessed ANSI escape codes:

f^[[102;1:3ug^[[103;1:3u

sometimes it detects my kill signal, otherwise i need to login again and kill it.

these are the flags im setting:

[features]
apply_patch_freeform = true
plan_tool = true
rmcp_client = true
streamable_shell = false
unified_exec = false
view_image_tool = true
experimental_windows_sandbox = true
parallel = true
terminal_resize_reflow = false

What steps can reproduce the bug?

  1. open codex
  2. send suspend ( ctrl+z )
  3. bring it back ( fg )
  4. type anything, i get broken ui

What is the expected behavior?

being able to resume chat

Additional information

_No response_

View original on GitHub ↗

12 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #25725
  • #26368

Powered by Codex Action

LC43 · 1 month ago

no, i dont have extra hooks and i dont use IME

clayg · 1 month ago

ran into this problem after upgrading to codex-cli 0.137.0

terminal suspend/resume used to work like #3464 cc @Nintorac

now it doesn't work

workaround for me was downgrade to known good version: sudo npm install -g @openai/codex@0.130

  • codex-cli 0.134.0 is also working
clayg · 1 month ago

I accidentally managed to get codex-cli 0.138.0 installed to ~/.local/bin/codex and this problem came back.

I'm now back on codex-cli 0.136.0 from /usr/bin/codex installed via sudo npm install -g @openai/codex@0.136 and that seems to be working.

gkoundry · 1 month ago

v0.139.0 was just released and it still has this issue.

GuyEP-Modulate · 1 month ago

I am also experiencing this issue as of 0.137.0+ on Gentoo Linux. I don't experience it on macOS 15.7.7 (24G720) with the same version (or later).

garybernhardt · 1 month ago

I'm seeing this inside of Linux containers, but not on the Mac host. Versions:

  • Host OS: macOS 15.6
  • Terminal: iTerm 2 3.6.10
  • Docker 29.5.3
  • Container OS: Ubuntu 24.04.3 LTS (Noble Numbat)
  • codex-cli 0.139.0 (But it's been happening since at least 0.137.0, as the OP here stated.)

Setting CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=1 seems to reduce the problem significantly.

djnz00 · 1 month ago

interactive shell suspend/resume broke within the past couple of weeks

kamou · 1 month ago
kamou · 1 month ago

From local tracing, the cause seems to be that recent Codex versions run the TUI on a spawned codex-main thread, but the Ctrl-Z path uses kill(0, SIGTSTP). On Linux, that process-directed stop can be delivered to another thread, allowing the TUI thread to continue and reapply terminal modes before the process is actually suspended. Using raise(SIGTSTP) from the TUI suspend path fixes the issue locally.

garybernhardt · 1 month ago

Thank you @kamou and @fcoury-oai!

fcoury-oai contributor · 1 month ago
Thank you @kamou and @fcoury-oai!

You're welcome! One less destoyed software!