1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

bash: do not export HIST* variables

These are interpreted by the shell itself and it does not make sense
to export them to sub-processes.
This commit is contained in:
Robert Helgesson 2018-01-07 16:54:29 +01:00
parent 78c308c835
commit 8ab6298f30
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86

View file

@ -132,8 +132,7 @@ in
);
export = n: v: "export ${n}=\"${toString v}\"";
exportIfNonNull = n: v: optionalString (v != null) (export n v);
exportIfNonEmpty = n: v: optionalString (v != "") (export n v);
setIfNonEmpty = n: v: optionalString (v != "") "${n}=${toString v}";
histControlStr = concatStringsSep ":" cfg.historyControl;
histIgnoreStr = concatStringsSep ":" cfg.historyIgnore;
@ -153,10 +152,10 @@ in
programs.bash.bashrcExtra = ''
# Commands that should be applied only for interactive shells.
if [[ -n $PS1 ]]; then
${export "HISTSIZE" cfg.historySize}
${export "HISTFILESIZE" cfg.historyFileSize}
${exportIfNonEmpty "HISTCONTROL" histControlStr}
${exportIfNonEmpty "HISTIGNORE" histIgnoreStr}
HISTSIZE=${toString cfg.historySize}
HISTFILESIZE=${toString cfg.historyFileSize}
${setIfNonEmpty "HISTCONTROL" histControlStr}
${setIfNonEmpty "HISTIGNORE" histIgnoreStr}
${shoptsStr}