Repository navigation
Fix out-of-range group window shortcuts - #8411
wxasacoder wants to merge 3 commits into
Conversation
TestingAdded regression coverage for:
Focused tests:
Manual verificationTested in a live Omarchy session with two grouped windows:
screenrecording-2026-08-26_23-51-11.mp4 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Lua 5.5 exits 0 when a script it reads from a pipe errors, so `lua <<'LUA'` swallowed every failed assertion and the test passed with the fix reverted. `lua -` reads the same heredoc and exits 1 on an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed and tested on a disposable Omarchy VM (Hyprland 0.56.2) by Claude Opus 5.5. The fix works: with a two-window group, real Super+Alt+3 and Super+Alt+5 key presses show I pushed one commit to your branch, b203ddc. The new test could not fail: on Lua 5.5, This fixes #12085. #10693 makes the same change later without a test, and #12155 includes it among five unrelated fixes. This one is the one to take forward. One side effect, found by reading the code rather than running it: as Lua functions, these five binds can no longer be run from the keybindings menu ( No second opinion ran. Codex Medium, the configured reviewer, answered a ping but refused the review because today's review budget is used up. For the same reason the classification at the new head could not be confirmed, so the |
Problem
Omarchy binds
Super + Alt + 1throughSuper + Alt + 5directly tohl.dsp.group.active.When the active group contains fewer windows than the selected index, Hyprland returns an

Index out of rangeLua runtime error. For example, with two windows in a group,Super + Alt + 1andSuper + Alt + 2work, but pressingSuper + Alt + 3produces an error notification. Repeated key presses can fill the screen with these notifications.Solution
Resolve the active window and its group when the shortcut is pressed, then dispatch the group switch only when the requested index is within
group.size.Valid group window shortcuts retain their existing behavior. Shortcuts targeting unavailable group positions, or used outside a window group, now safely do nothing.
This uses Hyprland's Lua window and group APIs directly instead of catching or matching runtime error messages.
Testing
bash test/shell.d/hyprland-group-bindings-test.sh.bash test/shell.d/hyprland-binding-conflicts-test.sh.