Skip to content

improve config error messages for duplicate binds#3536

Open
Ind-E wants to merge 1 commit intoniri-wm:mainfrom
Ind-E:main
Open

improve config error messages for duplicate binds#3536
Ind-E wants to merge 1 commit intoniri-wm:mainfrom
Ind-E:main

Conversation

@Ind-E
Copy link
Contributor

@Ind-E Ind-E commented Feb 27, 2026

For config files with duplicate keybinds, an additional error is emitted that points to the previous instance of the bind. If a single bind is repeated 3+ times, only the first duplicate will get an additional error.

For example, with this config:

binds {
    Mod+Shift+Slash { show-hotkey-overlay; }

    Mod+Shift+Slash { show-hotkey-overlay; }

    Mod+Tab { focus-workspace-previous; }

    Mod+Tab { focus-workspace-previous; }

    // ...

   Mod+Shift+Slash { show-hotkey-overlay; }
}

This error is shown

Error:   × error loading config
  ├─▶ error parsing
  ╰─▶ error parsing KDL

Error:   × duplicate keybind first defined here
     ╭─[config.kdl:337:1]
 337binds {
 338Mod+Shift+Slash { show-hotkey-overlay; }
     ·     ───────┬───────
     ·            ╰── node starts here
 339 │
     ╰────
Error:   × duplicate keybind later defined here
     ╭─[config.kdl:339:1]
 339340Mod+Shift+Slash { show-hotkey-overlay; }
     ·     ───────┬───────
     ·            ╰── unexpected keybind
 341 │
     ╰────
Error:   × duplicate keybind first defined here
     ╭─[config.kdl:341:1]
 341342Mod+Tab { focus-workspace-previous; }
     ·     ───┬───
     ·        ╰── node starts here
 343 │
     ╰────
Error:   × duplicate keybind later defined here
     ╭─[config.kdl:343:1]
 343344Mod+Tab { focus-workspace-previous; }
     ·     ───┬───
     ·        ╰── unexpected keybind
 345 │
     ╰────
Error:   × duplicate keybind later defined here
     ╭─[config.kdl:600:1]
 600601Mod+Shift+Slash { show-hotkey-overlay; }
     ·     ───────┬───────
     ·            ╰── unexpected keybind
 602 │ }
     ╰────

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.

1 participant