summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Högberg <john@erlang.org>2019-09-16 09:17:53 +0200
committerJohn Högberg <john@erlang.org>2019-09-16 09:17:53 +0200
commitda04cc20cc1527d142ab1890a44c277f450bfe7f (patch)
tree2f20ea1292e72f4a055c28a0e70c689d255a8853
parent4eb52e85b156132da98cdfa0ff2e811bceb69e8f (diff)
parent1c537cec846d324c1446d1ced460fc9d9c955479 (diff)
downloaderlang-da04cc20cc1527d142ab1890a44c277f450bfe7f.tar.gz
Merge branch 'john/kernel/fix-shell-history/PR-2302'
* john/kernel/fix-shell-history/PR-2302: kernel: Fix accidental disabling of shell history
-rw-r--r--lib/kernel/src/group_history.erl14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/kernel/src/group_history.erl b/lib/kernel/src/group_history.erl
index e69fa85492..1fab2ba14e 100644
--- a/lib/kernel/src/group_history.erl
+++ b/lib/kernel/src/group_history.erl
@@ -131,11 +131,15 @@ repair_log(Name) ->
%% Return whether the shell history is enabled or not
-spec history_status() -> enabled | disabled.
history_status() ->
- case is_user() orelse init_running() orelse application:get_env(kernel, shell_history) of
- true -> disabled; % don't run for user proc
- {ok, enabled} -> enabled;
- undefined -> ?DEFAULT_STATUS;
- _ -> disabled
+ %% Don't run for user proc or if the emulator's tearing down
+ Skip = is_user() orelse not init_running(),
+ case application:get_env(kernel, shell_history) of
+ {ok, enabled} when not Skip ->
+ enabled;
+ undefined when not Skip ->
+ ?DEFAULT_STATUS;
+ _ ->
+ disabled
end.
%% Return whether the user process is running this