mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
alacritty: fix toml escape generation
This commit is contained in:
@@ -100,8 +100,20 @@ in
|
||||
_finalAttrs: prevAttrs: {
|
||||
buildCommand = lib.concatStringsSep "\n" [
|
||||
prevAttrs.buildCommand
|
||||
# TODO: why is this needed? Is there a better way to retain escape sequences?
|
||||
"substituteInPlace $out --replace-quiet '\\\\' '\\'"
|
||||
# Nix cannot spell TOML escape sequences like "\u001d" directly:
|
||||
# "\\u001d" is a literal backslash-u string, while fromJSON creates
|
||||
# a control character and fails for "\u0000". Normalize both TOML
|
||||
# generator outputs to the Alacritty escape form:
|
||||
# chars = "\\u001d" -> chars = "\u001d"
|
||||
# chars = '\u001d' -> chars = "\u001d"
|
||||
''
|
||||
sed \
|
||||
-E \
|
||||
-e "s/= \"\\\\\\\\u([0-9a-fA-F]{4})\"\$/= \"\\\\u\1\"/" \
|
||||
-e "s/= '\\\\u([0-9a-fA-F]{4})'\$/= \"\\\\u\1\"/" \
|
||||
"$out" > "$TMPDIR/alacritty.toml"
|
||||
cp "$TMPDIR/alacritty.toml" "$out"
|
||||
''
|
||||
];
|
||||
}
|
||||
);
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
mods = "Control";
|
||||
chars = "\\u000c";
|
||||
}
|
||||
{
|
||||
key = "RBracket";
|
||||
mods = "Alt";
|
||||
chars = "\\u001d";
|
||||
}
|
||||
];
|
||||
|
||||
font =
|
||||
|
||||
@@ -9,6 +9,11 @@ chars = "\u000c"
|
||||
key = "K"
|
||||
mods = "Control"
|
||||
|
||||
[[keyboard.bindings]]
|
||||
chars = "\u001d"
|
||||
key = "RBracket"
|
||||
mods = "Alt"
|
||||
|
||||
[window.dimensions]
|
||||
columns = 200
|
||||
lines = 3
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
mods = "Control";
|
||||
chars = "\\u000c";
|
||||
}
|
||||
{
|
||||
key = "RBracket";
|
||||
mods = "Alt";
|
||||
chars = "\\u001d";
|
||||
}
|
||||
];
|
||||
|
||||
font = {
|
||||
|
||||
Reference in New Issue
Block a user