Skip to content

Limit unbindkeyset to the keyset or chain that was named - #3142

Open
burnhamrobertp wants to merge 1 commit into
beyond-all-reason:masterfrom
burnhamrobertp:bug/unbindkeyset-clears-chains
Open

Limit unbindkeyset to the keyset or chain that was named#3142
burnhamrobertp wants to merge 1 commit into
beyond-all-reason:masterfrom
burnhamrobertp:bug/unbindkeyset-clears-chains

Conversation

@burnhamrobertp

@burnhamrobertp burnhamrobertp commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #3141. Chains are stored under their last keyset, so the list for a key holds every chain ending with it, and unbindkeyset erased that whole list. unbindkeyset a therefore also dropped a,a and a,a,a.

It now parses a keychain rather than a single keyset and removes only the entries whose chain matches exactly, which also means you can name a chain to get at just that one. unbindkeyset a,a previously removed nothing at all, since the comma failed to parse.

Comparing with == keeps it from reaching across modifier combinations, same as #3136 does for unbind, so naming any+j won't take out a bound ctrl+j.

A key that only appears mid-chain still isn't reachable this way, which I think is right for a command that names a keyset - sc_a,sc_l,sc_a isn't the keyset sc_l. If we ever want "clear anything involving this key" that feels like its own command.

Nothing in BAR looks affected: it only unbindkeysets f11 variants and one dynamic keybind, and no chains end in f11.

Verified headless - naming the plain key, the 2-chain and the 3-chain each drop only their own binds, mid-chain is left alone, modifier matching is exact both ways, and all actions sharing a named keyset still go together.

Used Claude to help investigate and write this.

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.

unbindkeyset also clears chains that end with the key

2 participants