0

Is there a equivalent bash history command in iex?

After testing in iex, is there a way to list all history commands no need scroll up and down?

erlang history is added as follows:

export ERL_AFLAGS="-kernel shell_history enabled -kernel shell_history_path '\"$HOME/.iex_history\"'"
Adam Millerchip
  • 20,844
  • 5
  • 51
  • 74
Chen Yu
  • 3,955
  • 1
  • 24
  • 51
  • 1
    You do not need to set `shell_history_path` unless you are using something like docker which loses state, because it will use a [sensible default](https://www.erlang.org/doc/man/kernel_app.html#shell_history_path) anyway. In Elixir: `:filename.basedir(:user_cache, "erlang-history")`. – Adam Millerchip Sep 09 '22 at 05:23

1 Answers1

2

No, there is currently no function in iex to do this.

However, you can use CTRL + R to search the history.


By the way, erl has h() for this, although it seems to only list commands from the current session. It might be a nice addition to add to iex in the future.

Adam Millerchip
  • 20,844
  • 5
  • 51
  • 74