Skip to content

fix(cursor): handle exit code 3 in rtk-rewrite.sh#1100

Open
CamilleGuillory wants to merge 1 commit intortk-ai:developfrom
CamilleGuillory:fix-cursor-hook-exit-code-3
Open

fix(cursor): handle exit code 3 in rtk-rewrite.sh#1100
CamilleGuillory wants to merge 1 commit intortk-ai:developfrom
CamilleGuillory:fix-cursor-hook-exit-code-3

Conversation

@CamilleGuillory
Copy link
Copy Markdown

@CamilleGuillory CamilleGuillory commented Apr 9, 2026

Fixes #1099

The Cursor rtk-rewrite.sh hook was failing to rewrite commands because rtk rewrite exits with code 3 by default (when no explicit allow/deny rules are matched). The hook script was using || { echo '{}'; exit 0; }, which caused it to abort on any non-zero exit code.

This PR updates the Cursor hook to explicitly handle exit code 3 (Ask/Default) and exit code 0 (Allow) as successful rewrites, while ignoring exit codes 1 (No RTK equivalent) and 2 (Deny rule matched), similar to how the Claude Code hook handles it.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2026

CLA assistant check
All committers have signed the CLA.

@CamilleGuillory CamilleGuillory changed the base branch from master to develop April 9, 2026 09:50
@sebastiancichos
Copy link
Copy Markdown

that's duplicate of #1075

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.

Cursor hook fails to rewrite commands due to unhandled exit code 3

3 participants