<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">On 21 Jun 2017, 16:52 +0200, Fred Hebert <mononcqc@ferd.ca>, wrote:<br /></div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div dir="ltr">To turn shell history on, you can therefore do any of the following:<br />
<ul>
<li>Pass the arguments to the shell: <span style="font-family:monospace,monospace">$ erl</span> <code>-kernel shell_history enabled</code></li>
<li><code><span style="font-family:arial,helvetica,sans-serif">Create a configuration file like</span></code> <code><br />
[{kernel,[{shell_history, enabled}]}].</code><br />
<code><span style="font-family:arial,helvetica,sans-serif">and pass it to the shell:</span> $ erl -config hist.config</code></li>
<li><code><span style="font-family:arial,helvetica,sans-serif">You can create an alias for the shell with</span></code> <code>alias erl='erl -kernel shell_history enabled' <span style="font-family:arial,helvetica,sans-serif">in your dotfiles to get it always running</span><br /></code></li>
<li><code><span style="font-family:arial,helvetica,sans-serif">On windows you can create a shortcut to werl.exe and change the shortcut target to '</span>"C:\Program Files\erlang-otp-20\bin\werl.exe" -kernel shell_history enabled<span style="font-family:arial,helvetica,sans-serif"><span class="">'</span> to get it all automatically</span></code> <span style="font-family:arial,helvetica,sans-serif">-- you can do it in the start menu entry if that's the one you use the most by 'opening location' and editing the shortcut there.<br /></span></li>
</ul>
<p>The following apparently and sadly does not work, which confuses me quite a bit:</p>
<ul>
<li>editing $ROOT/lib/kernel-5.3/ebin/kernel.app and add the config directly in there</li>
<li><span style="font-family:arial,helvetica,sans-serif">Neither does creating a sys.config entry in the root release</span></li>
</ul>
<p>Let me know how that goes! </p>
</div>
</blockquote>
<br />
<div>I'm using locally the RC for some time now. I found that setting the ERL_AFLAGS or ERL_ZFLAGS environment variable is the easiest way to have shell history enabled "globally". I haven't actually seen any other uses of those flags (please correct me, if I'm wrong), so it shouldn't clash with anything either. Adding</div>
<div><br /></div>
<div> export ERL_AFLAGS="-kernel shell_history enabled"</div>
<div><br /></div>
<div>to your .profile/.bashrc/.zshrc (or equivalent) should be enough.</div>
<div><br /></div>
<div>MichaĆ.</div>
</div>
</body>
</html>