anomalyco / anomalyco/opencode
[FEATURE]: Configurable confirmation before exiting with Ctrl+D on macOS
@kommander is already working on this.
Since Aug 4, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
I use OpenCode on macOS with Ghostty, and I accidentally exit OpenCode several times a day by pressing Ctrl+D.
Ctrl+D is deeply ingrained in my terminal workflow, and when working with long-running agent sessions it's easy to hit it unintentionally, immediately terminating the session.
Comparison
I don't experience this with Claude Code, Codex CLI, or Kimi Code, since they require an additional action (such as confirmation or a second key press) before exiting, making accidental termination much less likely.
Proposal
Would it be possible to make exit confirmation configurable?
For example, one of the following:
- Require pressing
Ctrl+Dtwice within a short timeout. - Show a confirmation prompt before exiting.
- Add a configuration option (e.g.
confirm_exit: true). - Allow users to disable or remap
Ctrl+Dforapp_exitindependently.
This would preserve the current default behavior while allowing users who frequently hit Ctrl+D by accident to avoid losing active agent sessions.
Note: This is not a duplicate of the Ctrl+C discussions. This request is specifically about accidental exits caused by Ctrl+D on macOS.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.