claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] /terminal-setup operates on $XDG_CONFIG_HOME/alacritty/alacritty.toml instead of ~/alacritty.toml (if exists)

Open cosgroveb opened this issue 4 months ago • 1 comments

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

  1. Create an alacritty config at ~/.config/alacritty/alacritty.toml with custom settings (colors, fonts, etc.)
  2. Run /terminal-setup in Claude Code
  3. 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:

  1. Parse existing TOML and merge the binding
  2. Create a backup (.bak file)
  3. Warn users before overwriting

cosgroveb avatar Jan 02 '26 14:01 cosgroveb

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).

cosgroveb avatar Jan 02 '26 21:01 cosgroveb

don't forget the unparsability element to the list of supwize!

Image

violenz avatar Jan 07 '26 19:01 violenz

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"

varl avatar Jan 08 '26 08:01 varl

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"

xrash avatar Jan 25 '26 12:01 xrash

don't forget the unparsability element to the list of supwize!

This was super annoying, I also hit this.

rnestler avatar Feb 17 '26 17:02 rnestler