Is it possible to enable a command history feature for the iex console?

I mean to be able to go back to previously used commands using the up arrow key.

This is enabled by default for all versions of Erlang, but only ever affects the current session.

From Erlang OTP 20 on, you can enable a history that spans sessions:

Be aware though that on windows you might need to use werl/iex --werl.


I am running latest OTP and have just enabled it by:

export ERL_AFLAGS="-kernel shell_history enabled"

1 Like