From b5bb8dac05ae46b0c618600d1d6d963c30f04c57 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 15 Aug 2026 16:50:43 +0200 Subject: [PATCH] Repair foot.ini configs holding a literal \n[text-bindings] line (#6938) A 3.8.3 migration appended the section header with one backslash too many, so sed wrote the literal characters instead of a newline plus the header. foot rejects the line and stops reading the rest of the file. The later text-binding migration matches the header with grep -qxF, misses the broken line, and appends a second section, leaving the config broken across the Quattro upgrade. Closes #6903 Co-authored-by: Claude Opus 5 --- migrations/1786782461.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 migrations/1786782461.sh diff --git a/migrations/1786782461.sh b/migrations/1786782461.sh new file mode 100644 index 00000000..6247350b --- /dev/null +++ b/migrations/1786782461.sh @@ -0,0 +1,18 @@ +echo "Remove the literal \\n[text-bindings] line an earlier migration wrote into foot.ini" + +# A 3.8.3 migration appended the section header with `sed -i '$a\\\n[text-bindings]'`, +# one backslash too many, so GNU sed wrote a backslash and an "n" as two ordinary +# characters ahead of the section name, leaving the single line \n[text-bindings] +# where a blank line and a [text-bindings] header belong. foot rejects it with +# "syntax error: key/value pair has no value" and stops reading the rest of the file. +# +# The later text-binding migration looks for the header with `grep -qxF`, which the +# literal line doesn't match, so it appends a second real [text-bindings] section and +# leaves the broken line in place. Removing the line is what actually repairs the +# config; the duplicate section that migration added is valid and harmless. + +foot_config="$HOME/.config/foot/foot.ini" + +if [[ -f $foot_config ]] && grep -qxF '\n[text-bindings]' "$foot_config"; then + sed -i '/^\\n\[text-bindings\]$/d' "$foot_config" +fi