Skip to content

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

Closed

Description

@LC43

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

Activity

  1. added
    bugSomething isn't working
    on Jun 5, 2026
  2. added
    CLIIssues related to the Codex CLI
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    on Jun 5, 2026
  3. github-actions commented on Jun 5, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. LC43 commented on Jun 5, 2026

    @LC43
    Author

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

  5. clayg commented on Jun 5, 2026

    @clayg

    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
  6. clayg commented on Jun 9, 2026

    @clayg

    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.

  7. gkoundry commented on Jun 10, 2026

    @gkoundry

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

  8. GuyEP-Modulate commented on Jun 11, 2026

    @GuyEP-Modulate

    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).

  9. garybernhardt commented on Jun 11, 2026

    @garybernhardt

    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.

  10. djnz00 commented on Jun 15, 2026

    @djnz00

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

  11. kamou commented on Jun 16, 2026

    @kamou

    this patch fixes the problem: kamou@e09ac2f

  12. kamou commented on Jun 16, 2026

    @kamou

    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.

  13. added a commit that references this issue on Jun 16, 2026
    76135cb
  14. garybernhardt commented on Jun 16, 2026

    @garybernhardt

    Thank you @kamou and @fcoury-oai!

  15. fcoury-oai commented on Jun 16, 2026

    @fcoury-oai
    Contributor

    Thank you @kamou and @fcoury-oai!

    You're welcome! One less destoyed software!

  16. added a commit that references this issue on Jun 27, 2026
    ae846a9
  17. added 3 commits that reference this issue on Jul 5, 2026
    01569c9
    fdaf0f4
    8cbb128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions