diff options
author | John Högberg <john@erlang.org> | 2019-09-11 16:43:29 +0200 |
---|---|---|
committer | John Högberg <john@erlang.org> | 2019-09-11 16:50:15 +0200 |
commit | 1c537cec846d324c1446d1ced460fc9d9c955479 (patch) | |
tree | 20f4260404aefc5c99e268c615410d3d601e0be1 /lib | |
parent | 4d7a2e58c950983294487563877bdbac40224d9c (diff) | |
download | erlang-1c537cec846d324c1446d1ced460fc9d9c955479.tar.gz |
kernel: Fix accidental disabling of shell history
`orelse init_running()` would immediately drop us in the `true`
case where shell history was disabled.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kernel/src/group_history.erl | 14 |
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 |