Skip to content

Quit the running ChatGPT app before removing it - #18799

Merged
dhh merged 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/e1cf9d57-acbb-42aa-a828-9a56e8891ce3
Nov 15, 2026
Merged

dhh merged 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/e1cf9d57-acbb-42aa-a828-9a56e8891ce3

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

Removing ChatGPT while it is still open prints "ChatGPT has been removed." but leaves ~/.config/Codex behind, because the running app recreates it as soon as bin/omarchy-remove-ai-chatgpt deletes it.

Screenshots

Before After
before after

Reproduce

  1. Press Super+Space, choose Install > AI > ChatGPT Desktop, and wait for ChatGPT to open. Leave it running.
  2. Press Super+Space, choose Remove > AI > ChatGPT Desktop, and enter your sudo password when prompted.
  3. Press Enter to dismiss the Done! prompt.
  4. In a terminal, run ls ~/.config/Codex and ls ~/.cache/Codex.
  5. You see ~/.config/Codex back with component_crx_cache and BrowserMetrics-spare.pma, even though the package and ~/.cache/Codex are gone.

More cases

Direct CLI removal with ChatGPT running

Before After
before after

Related

The ChatGPT desktop app rewrites ~/.config/Codex for as long as it runs, so removing the package and deleting the directory while it is open left the app running and the directory recreated within the same second, even though the removal claimed success. Quit it first with `pkill -x chatgpt || true`, matching the Claude and Amp removers, before dropping the package and deleting its config and cache.
@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This update appears safe to merge.

Summary

Updates omarchy-remove-ai-chatgpt to target the running app by its case-sensitive name, ChatGPT.

  • ChatGPT stops before its package and files are removed.

Reviews (2) · Last reviewed commit: "Quit ChatGPT by the name it runs under" · Reviewed by Greptile

The /usr/bin/chatgpt launcher execs /usr/lib/chatgpt/ChatGPT, so the running process is named ChatGPT, and pkill -x matches case-sensitively: `pkill -x chatgpt` found nothing and the app kept rewriting ~/.config/Codex after the removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Pushed 7d51f21 on top of this branch, so this is ready for the maintainer.

What changed. pkill -x chatgpt became pkill -x ChatGPT. The package's /usr/bin/chatgpt launcher ends in exec /usr/lib/chatgpt/ChatGPT, so the running process is named ChatGPT, and pkill -x is case-sensitive: the old line matched nothing. The commit also carries the Claude and Amp removers' one-line reason above the pkill.

What was proved, on a worker built from the Omarchy ISO. With openai-codex-desktop installed and the app running (pgrep -x ChatGPT found 9 processes, pgrep -x chatgpt found 0), the remover at this PR's previous head (46d780f) exited 0 and printed "ChatGPT has been removed." Ten seconds later, 15 ChatGPT processes were still running and ~/.config/Codex had been recreated. After reinstalling and running the remover at 7d51f21, no ChatGPT processes were left and ~/.config/Codex stayed gone.

Tests. This PR has no test and gets none. It is a one-word fix, and a test asserting that a stub receives ChatGPT would only restate the edit. The real-app run above is the check that means something.

Second opinion. Codex Medium reviewed the new commit and found no defects. It agreed that no test is warranted. Its agreement is not guaranteed to be independent.

@dhh
dhh merged commit e5fb78a into omacom:quattro Nov 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants