codex - ✅(Solved) Fix `/stop` does not clear background terminals shown by `/ps` [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17311Fetched 2026-04-11 06:18:03
View on GitHub
Comments
2
Participants
3
Timeline
8
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2cross-referenced ×1unlabeled ×1

PR fix notes

PR #17416: Clear /ps after /stop

Description (problem / solution / changelog)

Addresses #17311

Problem: /stop stops background terminals, but /ps can still show stale entries because the TUI process cache is cleared only after later exec end events arrive.

Solution: Clear the TUI's tracked unified exec process list and footer immediately when /stop submits background terminal cleanup.

Changed files

  • codex-rs/tui/src/chatwidget.rs (modified, +2/-0)

Code Example

Stopping all background terminals.

/ps

Background terminals

  • ls && find . -maxdepth 2 -name '*.csproj' -o -name '*.sln' && dotnet build -nolo [...]

Stopping all background terminals.

/ps

Background terminals

  • ls && find . -maxdepth 2 -name '*.csproj' -o -name '*.sln' && dotnet build -nolo [...]
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

v0.118.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.4 fast

What platform is your computer?

macOS 26.4

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

Ghostty

What issue are you seeing?

/stop says it stopped all background terminals, but /ps still shows the same zombie terminal afterward.

What steps can reproduce the bug?

  1. Ask codex to run a task that creates a background terminal
  2. Run /ps
  3. Run /stop
  4. Run /ps again

The same background terminal is still listed after /stop.

What is the expected behavior?

After /stop, /ps should no longer show that terminal.

Additional information

• Stopping all background terminals.

/ps

Background terminals

  • ls && find . -maxdepth 2 -name '*.csproj' -o -name '*.sln' && dotnet build -nolo [...]

• Stopping all background terminals.

/ps

Background terminals

  • ls && find . -maxdepth 2 -name '*.csproj' -o -name '*.sln' && dotnet build -nolo [...]
```

extent analysis

TL;DR

The issue can be mitigated by investigating the zombie terminal process and potentially manually terminating it.

Guidance

  • Verify the background terminal process is indeed a zombie process by checking its status in the operating system's process manager.
  • Check the Codex CLI documentation for any known issues or limitations with the /stop command, particularly with regards to zombie processes.
  • Consider manually terminating the zombie process using the operating system's process management tools to see if this resolves the issue.
  • If the issue persists, try restarting the Codex CLI or the terminal emulator to see if this clears the zombie process.

Example

No code snippet is provided as the issue is related to a specific CLI tool and its interaction with the operating system.

Notes

The issue may be related to a limitation or bug in the Codex CLI's /stop command, particularly with regards to handling zombie processes. Further investigation and potentially reaching out to the Codex CLI support team may be necessary to fully resolve the issue.

Recommendation

Apply workaround: Manually terminate the zombie process using the operating system's process management tools, as this may provide a temporary solution until the root cause can be identified and addressed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING