Skip to content

Commit e6165c0

Browse files
author
José Valim
committed
Document how to get shell history
1 parent 27c492d commit e6165c0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/iex/lib/iex.ex

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,26 @@ defmodule IEx do
2727
to work. `--werl` may be permanently enabled by setting the `IEX_WITH_WERL`
2828
environment variable.
2929
30+
## Shell history
31+
32+
From Erlang/OTP 20, it is possible to get shell history by passing some
33+
flags that enable it in the VM. This can be done on a per-need basis
34+
when starting IEx:
35+
36+
iex --erl "-kernel shell_history enabled"
37+
38+
If you would rather enable it on your system as a whole, you can use
39+
the `ERL_AFLAGS` environment variable and make sure that it is set
40+
accordingly on your terminal/shell configuration.
41+
42+
On Linux:
43+
44+
export ERL_AFLAGS="-kernel shell_history enabled"
45+
46+
On Windows:
47+
48+
set ERL_AFLAGS "-kernel shell_history enabled"
49+
3050
## The Break command
3151
3252
Inside IEx, hitting `Ctrl+C` will open up the `BREAK` menu. In this

0 commit comments

Comments
 (0)