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:
parent
78c308c835
commit
8ab6298f30
|
@ -132,8 +132,7 @@ in
|
||||||
);
|
);
|
||||||
|
|
||||||
export = n: v: "export ${n}=\"${toString v}\"";
|
export = n: v: "export ${n}=\"${toString v}\"";
|
||||||
exportIfNonNull = n: v: optionalString (v != null) (export n v);
|
setIfNonEmpty = n: v: optionalString (v != "") "${n}=${toString v}";
|
||||||
exportIfNonEmpty = n: v: optionalString (v != "") (export n v);
|
|
||||||
|
|
||||||
histControlStr = concatStringsSep ":" cfg.historyControl;
|
histControlStr = concatStringsSep ":" cfg.historyControl;
|
||||||
histIgnoreStr = concatStringsSep ":" cfg.historyIgnore;
|
histIgnoreStr = concatStringsSep ":" cfg.historyIgnore;
|
||||||
|
@ -153,10 +152,10 @@ in
|
||||||
programs.bash.bashrcExtra = ''
|
programs.bash.bashrcExtra = ''
|
||||||
# Commands that should be applied only for interactive shells.
|
# Commands that should be applied only for interactive shells.
|
||||||
if [[ -n $PS1 ]]; then
|
if [[ -n $PS1 ]]; then
|
||||||
${export "HISTSIZE" cfg.historySize}
|
HISTSIZE=${toString cfg.historySize}
|
||||||
${export "HISTFILESIZE" cfg.historyFileSize}
|
HISTFILESIZE=${toString cfg.historyFileSize}
|
||||||
${exportIfNonEmpty "HISTCONTROL" histControlStr}
|
${setIfNonEmpty "HISTCONTROL" histControlStr}
|
||||||
${exportIfNonEmpty "HISTIGNORE" histIgnoreStr}
|
${setIfNonEmpty "HISTIGNORE" histIgnoreStr}
|
||||||
|
|
||||||
${shoptsStr}
|
${shoptsStr}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue