Skip to content

[Bug]: Ctrl+C in "Edit" commit message step commits Symbol(clack:cancel) instead of cancelling #560

Description

@scillidan

Opencommit Version

v3.2.19

Node Version

v22.13.1

NPM Version

10.9.2

What OS are you seeing the problem on?

No response

What happened?

A bug happened!

Expected Behavior

The operation should be cancelled (process exits).

Current Behavior

The commit proceeds with Symbol(clack:cancel) as the commit message:

[llama.cpp d0426fd] Symbol(clack:cancel)
1 file changed, 23 insertions(+), 2 deletions(-)

Possible Solution

I don't know but AI said:

@clack/prompts text() returns Symbol(clack:cancel) on Ctrl+C instead of throwing. The isCancel() check is missing after the "Edit" text input in commit.ts, so the cancel symbol is treated as the edited commit message.

Steps to Reproduce

Steps to Reproduce

  1. Run oco with staged files
  2. Select "Edit" at "Confirm the commit message?"
  3. Press Ctrl+C at the text input prompt

Relevant log output

[Pasted ~14 lin■  Please edit the commit message: (press Enter to continue)
│  feat(README.md): update OCO_AI_PROVIDER list to include llamacpp
│
│
◇  ✔ Successfully committed
│
└  [llama.cpp d0426fd] Symbol(clack:cancel)
 1 file changed, 23 insertions(+), 2 deletions(-)

│
◆  Choose a remote to push to
│  ● origin
│  ○ upstream
│  ○ don't push

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions