foot: enable duplicate key-bindings (#6815)

closes #5873
This commit is contained in:
1adept 2025-04-14 00:46:54 +02:00 committed by GitHub
parent 1422924908
commit ac3c1f4fa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 42 additions and 1 deletions

View file

@ -6,7 +6,7 @@
}:
let
cfg = config.programs.foot;
iniFormat = pkgs.formats.ini { };
iniFormat = pkgs.formats.ini { listsAsDuplicateKeys = true; };
in
{
meta.maintainers = with lib.maintainers; [ plabadens ];

View file

@ -2,4 +2,5 @@
foot-example-settings = ./example-settings.nix;
foot-empty-settings = ./empty-settings.nix;
foot-systemd-user-service = ./systemd-user-service.nix;
foot-regex-modes = ./regex-modes.nix;
}

View file

@ -0,0 +1,11 @@
[key-bindings]
regex-launch=[one] Shift+Control+1
regex-launch=[two] Shift+Control+2
[regex:one]
launch=echo Regex one works
regex=(some regex)
[regex:two]
launch=echo Second also works!
regex=(some other regex)

View file

@ -0,0 +1,29 @@
{ config, ... }:
{
programs.foot = {
enable = true;
package = config.lib.test.mkStubPackage { };
settings = {
"regex:one" = {
regex = "(some regex)";
launch = "echo Regex one works";
};
"regex:two" = {
regex = "(some other regex)";
launch = "echo Second also works!";
};
key-bindings.regex-launch = [
"[one] Shift+Control+1"
"[two] Shift+Control+2"
];
};
};
nmt.script = ''
assertFileContent \
home-files/.config/foot/foot.ini \
${./regex-modes-expected.ini}
'';
}