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?
- open codex
- send suspend ( ctrl+z )
- bring it back ( fg )
- type anything, i get broken ui
What is the expected behavior?
being able to resume chat
Additional information
_No response_
12 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
no, i dont have extra hooks and i dont use IME
ran into this problem after upgrading to
codex-cli 0.137.0terminal 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.130codex-cli 0.134.0is also workingI accidentally managed to get
codex-cli 0.138.0installed to~/.local/bin/codexand this problem came back.I'm now back on
codex-cli 0.136.0from/usr/bin/codexinstalled viasudo npm install -g @openai/codex@0.136and that seems to be working.v0.139.0 was just released and it still has this issue.
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).
I'm seeing this inside of Linux containers, but not on the Mac host. Versions:
Setting
CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=1seems to reduce the problem significantly.interactive shell suspend/resume broke within the past couple of weeks
this patch fixes the problem: https://github.com/kamou/codex/commit/e09ac2f76004ae061d9c99bfce6f87e7072f5dcc
From local tracing, the cause seems to be that recent Codex versions run the TUI on a spawned
codex-mainthread, but the Ctrl-Z path useskill(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. Usingraise(SIGTSTP)from the TUI suspend path fixes the issue locally.Thank you @kamou and @fcoury-oai!
You're welcome! One less destoyed software!