mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-21 17:59:39 +01:00
readline: Add support for keynames (#3947)
Kenames like `Control-n` or `meta-p` should not be quoted or they don't work. Keyseqs like `\C-p` or `ab` must continue to be quoted. See also: https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html Fixes https://github.com/nix-community/home-manager/issues/3611
This commit is contained in:
parent
ae6d5466bf
commit
f3824311a1
3 changed files with 13 additions and 2 deletions
|
|
@ -21,7 +21,14 @@ let
|
|||
abort ("values ${toPretty v} is of unsupported type");
|
||||
in "set ${n} ${mkValueStr v}";
|
||||
|
||||
mkBindingStr = k: v: ''"${k}": ${v}'';
|
||||
mkBindingStr = k: v:
|
||||
let
|
||||
isKeynameNotKeyseq = k:
|
||||
builtins.elem (builtins.head (lib.splitString "-" (toLower k))) [
|
||||
"control"
|
||||
"meta"
|
||||
];
|
||||
in if isKeynameNotKeyseq k then "${k}: ${v}" else ''"${k}": ${v}'';
|
||||
|
||||
in {
|
||||
options.programs.readline = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue