We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
How to Enable IEx Shell History and Search
Have you ever CTRL-C
‘d your way out of a long running IEx session? All of your commands, bound variables, imports, and aliases down the toilet.
If only IEx had a shell history - like bash or zsh.
Well today is your lucky day, because here’s how to enable IEx (and erl) shell history!
The Secret
Add this line to your bash (or zsh) profile:
# IEx (and erl) shell history
export ERL_AFLAGS="-kernel shell_history enabled"
This line will persist your history between IEx sessions
If you’d like to configure the size of the history, the flag -kernel shell_history_file_bytes
can be used (The default is 512KB)
-
1MB:
-kernel shell_history_file_bytes 1024000
-
2MB (You probably don’t need more than this):
-kernel shell_history_file_bytes 2048000
This lets you use the up arrow for previous commands and use CTRL-r
reverse search. IEx just got a whole lot more ergonomic!
Build an AI Powered Instagram Clone with LiveView is on sale now!