Skip to content

fix(input): reject input macro keys ending in a repeat suffix - #68

Merged
wizzomafizzo merged 1 commit into
mainfrom
fix/input-macro-ambiguous-repeat
Aug 30, 2026
Merged

fix(input): reject input macro keys ending in a repeat suffix#68
wizzomafizzo merged 1 commit into
mainfrom
fix/input-macro-ambiguous-repeat

Conversation

@wizzomafizzo

Copy link
Copy Markdown
Member
  • parseSuffixRepeat splits a braced input macro token at the last * followed by digits, so content carrying two repeat suffixes left a key name that still ended in one. expandInputMacroExt then emitted a {name} token that Command.String() could not write back, because re-reading it stripped the suffix a second time.
  • **input.keyboard:{*1*1} serialised to **input.keyboard:{*1}, which failed to reparse with ErrInputMacroEmptyKey; {a*1*2} serialised to two {a*1} tokens that read back as two a tokens.
  • Reject the ambiguous form at parse time with a new ErrInputMacroAmbiguousKey rather than producing a token that cannot round-trip. Key names where * is literal ({ctrl+*}, {a*b}, {a*0}, {*}) are unaffected, since the check only fires when the leftover name would itself be re-split.
  • Add the failing FuzzCommandString corpus entry from the nightly run as a regression seed, plus error and positive cases covering the surrounding * handling.

All 23 open nightly fuzz issues are this one crash, re-reported each night.

Closes #22, closes #30, closes #38, closes #39, closes #40, closes #41,
closes #42, closes #43, closes #45, closes #47, closes #48, closes #52,
closes #53, closes #55, closes #56, closes #57, closes #58, closes #59,
closes #60, closes #61, closes #62, closes #64, closes #65

parseSuffixRepeat splits a braced input macro token at the last '*'
followed by digits. When the content carries two repeat suffixes the
leftover key name still ends in one, so expandInputMacroExt emitted a
"{name}" token that Command.String() could not write back: re-reading it
stripped the suffix a second time.

"{*1*1}" serialised to "{*1}" and failed to reparse, while "{a*1*2}"
serialised to two "{a*1}" tokens that read back as two "a" tokens.

Reject the ambiguous form at parse time instead of producing a token that
cannot round-trip. Names where '*' is literal ("{ctrl+*}", "{a*b}",
"{a*0}", "{*}") are unaffected.
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 5 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d45e0b5-990d-47a2-ba37-3e2467d24ddb

📥 Commits

Reviewing files that changed from the base of the PR and between 1a882e9 and 19e74da.

📒 Files selected for processing (4)
  • arguments.go
  • parser_input_macro_test.go
  • symbols.go
  • testdata/fuzz/FuzzCommandString/8b2c3a3ac03788e5

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@wizzomafizzo
wizzomafizzo merged commit 53592bc into main Aug 30, 2026
12 checks passed
@wizzomafizzo
wizzomafizzo deleted the fix/input-macro-ambiguous-repeat branch August 30, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment