You can also save this history to a file (but there’s no easy way to *edit* the
history otherwise):
```
defmodule IexHistory do
@moduledoc false
def save_history(filename \\ "iex_history.exs") do
File.write!(filename, Enum.reverse(:group_history.load()))
end
end
```
-a
On Fri, Aug 7, 2020 at 2:13 PM Adam Lancaster <[email protected]> wrote:
> You can do this already
>
>
> https://til.hashrocket.com/posts/is9yfvhdnp-enable-history-in-iex-through-erlang-otp-20-
>
>
>
> On Fri, 7 Aug 2020 at 19:09, Michał Gibowski <[email protected]> wrote:
>
>> Hi,
>>
>> I come from Scala and I am used to that REPL history is persisted across
>> sessions. So if I close console and open it again within the same project,
>> I can still press arrow key on my keyboard and access commands from the
>> previous session.
>>
>> The same experience is supported by psql and probably many other tools.
>>
>> I think it would be great to have this in iex too.
>>
>> The history would be per project and could be stored in a file called for
>> example .iex.history. I am not sure if it's necessary to place some any to
>> it's size.
>>
>> What do you think?
>>
>> Cheers,
>> Michal Gibowski
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elixir-lang-core/b71f3ed1-3e4c-4f5d-bb3b-262d288ac91co%40googlegroups.com
>> <https://groups.google.com/d/msgid/elixir-lang-core/b71f3ed1-3e4c-4f5d-bb3b-262d288ac91co%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/CADwgC_BwVMg6y9U0JebSqrWpyVG4p2FQddgejWCvKXEt5pZuzQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/elixir-lang-core/CADwgC_BwVMg6y9U0JebSqrWpyVG4p2FQddgejWCvKXEt5pZuzQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
Austin Ziegler • [email protected] • [email protected]
http://www.halostatue.ca/ • http://twitter.com/halostatue
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/CAJ4ekQsWYfUWS%3DRG81Qtg0DqbRvXCvehnVq5%3D3kBaj-cSFCzHw%40mail.gmail.com.