Skip to content

Instantly share code, notes, and snippets.

@saterus
Created July 23, 2019 14:29
Show Gist options
  • Save saterus/d7afd4d6003b8c2c9fcc7fa45767d0c6 to your computer and use it in GitHub Desktop.
Save saterus/d7afd4d6003b8c2c9fcc7fa45767d0c6 to your computer and use it in GitHub Desktop.

Setup Elixir History:

  1. touch ~/.iex_history
  2. Set the ERL_AFLAGS env var: bash: echo "export ERL_AFLAGS='-kernel shell_history enabled'" >> ~/.bashrc zsh: echo "export ERL_AFLAGS='-kernel shell_history enabled'" >> ~/.zshrc fish: set -Ux ERL_AFLAGS '-kernel shell_history enabled'
  3. Add some history:
    $  iex                                                                                                                                                                 (/f/s/2/s/script_drop) 12:09:25
    Erlang/OTP 22 [erts-10.4.3] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
    
    Interactive Elixir (1.9.0) - press Ctrl+C to exit (type h() ENTER for help)
    iex(1)> :hi
    :hi
    iex(2)>
    BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
           (v)ersion (k)ill (D)b-tables (d)istribution
    ^C
    
  4. Load the history:
    $  iex                                                                                                                                                                 (/f/s/2/s/script_drop) 12:09:25
    Erlang/OTP 22 [erts-10.4.3] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
    
    Interactive Elixir (1.9.0) - press Ctrl+C to exit (type h() ENTER for help)
    iex(1)> HIT_THE_UP_ARROW
    iex(1)> :hi
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment