[erlang-questions] OTP R16A has been released

Fred Hebert <>
Thu Jan 31 00:07:10 CET 2013

That's what it is. It searches the line stack. It's a *history-search*
patch, not a general history-saving patch.

I have https://github.com/ferd/erlang-history that implements a search
that can be saved, but there's still work to do in it before it can be
good enough for OTP:

1. it relies on DETS, and DETS seems to corrupt files from time to time
   either when too many shells write to it, or when it's interrupted
   while dumping. I want to get rid of DETS at some point for some other
   line utility, maybe disk_log.
2. I'll need to make it use a .erlang/ directory in $HOME rather than
   plenty of .erlang.$NAME files. There's a truckload of .erlang.*
   config files around, and one per named shell is problematic.
3. Multiple shells are implemented in an okay way, but there may be a
   need to correct codes when many shells write to the same file
   (usually multiple non-distributed shells).
4. The usual OTP cleanup and formatting is required.
5. I haven't considered the issue of multiple encodings used in the same
   shell history file yet.
6. I haven't asked the OTP team what they think should be done at that
   point, but I'd be fine forking this thread to start discussing it.

Lately I haven't had the time/motivation to do that heavy lifting,
but with the book and university done, I'll probably find time here and
there to try and make a better implementation.

In the mean time, I'll keep the repository above up to date. It's not
yet ready for R16A support -- I use the compiler versions to deal with
things and the new code can't be the same to make it there. It should
work fine with the new ^R support feature.

Shell history is a tiny bit about injecting history in a shell and is
*mostly* about handling files on disk. Shell history search is pretty
much handling the line stack in the shell and edlin, so that one was
much simpler to deal with than history to make it part of OTP :)


On 01/30, Motiejus Jakštys wrote:
> On Wed, Jan 30, 2013 at 3:40 PM, Fred Hebert <> wrote:
> > Also:
> >
> >   OTP-10739  Add search to Erlang shell's history. Thanks to Fred
> >    Herbert.
> History between sessions is not implemented (I get readline-style
> ctrl-r in same session fine which is super cool)?
> /home/motiejus$ erl -config hist.config -name labas
> Erlang R16A (erts-5.10) [source] [smp:2:2] [async-threads:10] [hipe]
> [kernel-poll:false]
> Eshell V5.10  (abort with ^G)
> ()1> application:get_all_env(kernel).
> [{hist_file,"erlang-history"},
>  {included_applications,[]},
>  {error_logger,tty},
>  {hist_size,120},
>  {hist_drop,["q().","init:stop()."]}]
> ()2> q().
> ok
> ()3> %
> /home/motiejus$ ls -lA | grep erlang
> -r--------  1 motiejus motiejus      20 Rgp 23 23:00 .erlang.cookie
> -- 
> Motiejus Jakštys

More information about the erlang-questions mailing list