Skip to content

[FEATURE]: Configurable confirmation before exiting with Ctrl+D on macOS #40510

Description

@silvioprog

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+D twice 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+D for app_exit independently.

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions