Skip to content

Ctrl+C exits via SIGINT (status 130) so TUI skips session summary/resume hint on WSL2 #9448

@EnvyGithub

Description

@EnvyGithub

What version of Codex is running?

codex-cli 0.87.0

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 (WSL2 on Windows; Windows Terminal)

What issue are you seeing?

In the interactive TUI, pressing Ctrl+C sometimes terminates the process via SIGINT (exit status 130).
When this happens, Codex does not print the session summary / "To continue this session, run codex resume ..." message.

This makes it look like an abnormal exit and loses the resume hint.

Steps to reproduce

  1. Run codex (interactive TUI) inside WSL2.
  2. Send any prompt so token usage is non-zero.
  3. Press Ctrl+C.
  4. Observe that the process exits immediately and echo $? is 130.
  5. Observe that no session summary/resume hint is printed.

Expected behavior

Ctrl+C should be handled by the TUI input handling (like other Ctrl+C paths) and exit gracefully:

  • print session summary / resume hint (when token usage is non-zero)
  • avoid being killed by SIGINT

Workaround

Use /quit or /exit (or Ctrl+D when composer is empty) to exit cleanly.

Additional context

Other parts of the codebase already handle Ctrl+C via tokio::signal::ctrl_c() (e.g. codex-exec and core exec paths),
but the interactive TUI does not appear to listen for SIGINT/ctrl_c, so the process can be terminated before printing exit info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions