[BUG] /terminal-setup operates on $XDG_CONFIG_HOME/alacritty/alacritty.toml instead of ~/alacritty.toml (if exists)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The /terminal-setup command ignored the alacritty configuration file at ~/.alacritty.toml, writing to a non-existent ~/.config/alacritty/alacritty.toml instead of merging the Shift+Return keyboard binding. This causes overriding of all existing settings including color schemes, fonts, window options, and custom keyboard bindings.
What Should Happen?
/terminal-setup should preserve existing configuration by reading the current alacritty config in all valid locations and merging the keyboard binding into the existing [keyboard.bindings] array
Steps to Reproduce
- Create an alacritty config at ~/.config/alacritty/alacritty.toml with custom settings (colors, fonts, etc.)
- Run /terminal-setup in Claude Code
- Check the alacritty config file - all previous settings are replaced with just the keyboard binding
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
The command should either:
- Parse existing TOML and merge the binding
- Create a backup (.bak file)
- Warn users before overwriting
I am not entirely certain what should be the default behavior here, and I will likely move my alacritty config to $XDG_CONFIG_HOME anyways but it was a bit surprising that this slash command created a net-new config file that took precedence over $HOME/alacritty.toml (and part of the surprise here is also because of how alacritty itself sources configuration).
don't forget the unparsability element to the list of supwize!
don't forget the unparsability element to the list of supwize!
Changing the config to use \xxxx escapes instead of \x fixes it for me:
chars = "\u001b\r"
Not only I had the same issue, but I already had a keyboard.bindings section in my alacritty config and claude code added another keyboard.bindings section, which would cause a "duplicate key" error:
[keyboard] # i already had this
bindings = [
{ key = "N", mods = "Control|Shift", action = "SpawnNewInstance" },
]
[[keyboard.bindings]] # this was added by claude code
key = "Return"
mods = "Shift"
chars = "\x1b\r"
don't forget the unparsability element to the list of supwize!
This was super annoying, I also hit this.