After I use Ctrl-C to stop the server, recompile and restart I realize that I can’t use the cursor key to recollect the commands from the previous session.
The cursor keys give only the commands I have entered in the new iex -S mix session.
Is that the normal behaviour? Command line tools mysql and psql have a history going back to previous sessions and I wonder if iex has the samel
Unfortunately, there is no such feature because it’s not supported by the underlying Erlang shell. There is a closed issue on Github which documents this: https://github.com/elixir-lang/elixir/issues/2945
The erlang-history module mentioned by @outlog and also referenced in the Gihub issue seems to be a little bit hacky and its author stated that the history might get corrupted from time to time. But still, better than no history at all, I suppose
Just as a note, this is how the shell works on everything but Windows.
For some reason on my work Windows 10 computer I get history going all the way back, and I also only have to hit Ctrl+c once, the job menu never appears (which sucks at times I do admit). I’m unsure why Windows has history and only have to hit Ctrl+c once, maybe @josevalim knows?