How do I save IEx history?

For Erlang/OTP 20 This is built-in (from https://hexdocs.pm/iex/IEx.html#module-shell-history) From Erlang/OTP 20, it is possible to get shell history by passing some flags that enable it in the VM. This can be done on a per-need basis when starting IEx: iex –erl “-kernel shell_history enabled” If you would rather enable it on your system as a … Read more

Pry while testing

You need to start your tests inside an iex session – you can do that by running iex -S mix test. Then you can use IEx.pry inside your test: require IEx test “the truth” do one = 1 IEx.pry assert one + one == 2 end You’ll be asked if you want to allow prying … Read more

Elixir Sleep / Wait for 1 Second

Timer uses milliseconds not seconds, update to: IO.puts “foo” ; :timer.sleep(1000); IO.puts “bar” Documentation of :timer in Erlang’s doc: Suspends the process calling this function for Time amount of milliseconds and then returns ok, or suspend the process forever if Time is the atom infinity. Naturally, this function does not return immediately. http://erlang.org/doc/man/timer.html#sleep-1