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 │ }
     ╰────

@Sempyos Sempyos added the area:config Config parsing, default config, new settings label Mar 11, 2026
Copy link
Member

@bluelinden bluelinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good QoL change

@bluelinden
Copy link
Member

@sodiboo you tried to get this working previously, does it look right to you?

@Sempyos Sempyos added the pr kind:feature New features and functionality label Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:config Config parsing, default config, new settings pr kind:feature New features and functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants