Fix infinite iteration in Lua keybindings scanner - #11867
Closed
filippov-au wants to merge 1 commit into
Closed
filippov-au wants to merge 1 commit into
filippov-au wants to merge 1 commit into
Conversation
filippov-au
marked this pull request as ready for review
September 14, 2026 23:34
Member
|
Automated duplication check: this pull request looks similar to #8876, which covers the same keybindings scanner ipairs termination fix. I keep that one open and close this one to consolidate review. If you feel this is the wrong decision, please open the PR again with a note on the difference. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening the keybindings menu can hang at 100% of one CPU core when custom Hyprland configuration iterates over a runtime collection, such as
ipairs(hl.get_monitors()). For example, monitor configuration may check whether a streaming output exists before disabling another output. That loop completes normally in Hyprland but never finishes in the menu’s Lua scanner.The scanner substitutes a callable
nooptable for unsupported Hyprland APIs. Its__indexreturns that same table for every key, soipairsnever reachesnil. Returnnilfor numeric lookups so these placeholders behave as empty collections, while retaining named lookups and calls. This lets the scanner continue collecting bindings without requiring menu-specific guards in user configuration.Extend the existing keybindings menu test with monitor and nested window-tag loops, a normal configuration call, and a binding declared after the loops. A timeout catches the original hang; checking the resolved binding also catches a scan that exits early with an error.
Validation:
bash test/shell.d/keybindings-menu-test.sh, Bash syntax checks, andgit diff --checkpass../test/allagainst both upstream and the patch: the CLI suite passes, and both have the same three environment-related shell test failures. All three pass on both versions when rerun with the required setup: unsetNO_COLORforlaunch-about, allow route lookup fornetwork-qr, and provide theomarchy-isocheckout forsnapper. No new test failures.