/terminal-setup uses invalid TOML escape sequence \x1b for Alacritty config
Status Fixed / completed
Reported on v2.0.74
Maintainer reply ✓ Yes — cg505
Workaround ✓ Mentioned in thread ↓
Activity 9 comments · opened Dec 19, 2025 · closed Apr 18, 2026
💡 Likely answer: A maintainer (cg505, contributor)
responded on this thread — see the highlighted reply below.
Bug Description
The /terminal-setup command writes an invalid escape sequence to the Alacritty TOML config file, causing Alacritty to fail to load the configuration.
Steps to Reproduce
- Run
/terminal-setupin Claude Code - Select Alacritty as the terminal
- Alacritty shows a config parse error
Error Message
[ERROR] Unable to load config "/Users/username/.config/alacritty/alacritty.toml": Config error: TOML parse error at line 28, column 11
28 | chars = "\x1b\r"
| ^
missing escaped value, expected 'b', 'f', 'n', 'r', '\', '"', 'u', 'U'
Root Cause
The generated config uses \x1b (hex escape) which is not valid in TOML. TOML only supports these escape sequences:
\b,\f,\n,\r,\t,\\,\"\uXXXX(4-digit Unicode)\UXXXXXXXX(8-digit Unicode)
Fix
Replace \x1b with \^[ in the generated Alacritty config:
# Wrong (current)
chars = "\x1b\r"
# Correct (should be)
chars = "\^[\r"
Environment
- Claude Code version: 2.0.74
- OS: macOS
- Terminal: Alacritty
9 Comments
I experienced this error and this fix worked for me
Workaround Confirmed Working on Linux + Alacritty
I can confirm this workaround resolves the Shift+Enter issue for Alacritty on Linux.
Environment
Solution
Add this to your
~/.config/alacritty/alacritty.toml:This uses valid TOML syntax (
\nfor newline) instead of the invalid\x1bhex escape that/terminal-setuptries to generate.Steps
~/.config/alacritty/alacritty.tomlin your editor[[keyboard.bindings]]section)Tested and working - Shift+Enter now properly inserts newlines without breaking the TOML config.
Thanks, experienced the same bug and this worked for me too!
On Omarchy keyboard bindings are already defined like this:
So it needs:
Slightly hijacking this to also suggest including
mode = "~Search"in the binding to retain the "jump to previous match" behavior in search mode.Confirming this issue on Linux (CachyOS/Arch) with Alacritty. The fix works for me too.
The fix is straightforward — TOML requires
\^[(Unicode escape) instead of\x1b(hex escape).Manual fix for your Alacritty config:
Replace:
With:
\^[is the TOML-valid Unicode escape for ESC (U+001B). This is equivalent to\x1bbut uses the escape format TOML actually supports.If
/terminal-setupoverwrites your fix:You can protect the corrected config with a PostToolUse hook that auto-patches after any Bash operation:
This silently corrects any
\x1b→\^[in your Alacritty config after tool operations.This was fixed in v2.1.45 — /terminal-setup now writes a TOML-valid \^[ escape to the Alacritty config instead of the invalid \x1b. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.