LoginSignup
19
17

More than 5 years have passed since last update.

ElixirのシェルIExの履歴の保存

Last updated at Posted at 2015-09-02

【更新】OTP20

OTP20からErlangの-kernel shell_history enabledというフラグで履歴が保存されるようになったので、常にこの設定が使われるようにERL_AFLAGSを設定すれば良いです。例えば~/.zshrc辺りに

export ERL_AFLAGS="-kernel shell_history enabled"

を追加すれば良い。

元記事

最近Elixirを使い始めているのですが、Elixirのシェルに1つ不満がありました。セッションを閉じると履歴が保存されません。pryやipythonに慣れていたもので、その機能が欲しかったです。

調べてみたところで、Elixirの問題ではなく、Erlangの問題らしいので、Erlangで使われているワークアラウンドで行けるとのことでした。

erlang-historyというプロジェクトが問題なく動いてくれました。

git clone https://github.com/ferd/erlang-history.git 
cd erlang-history
make install

で無事に履歴が保存されるようになれました。Erlangのインストールディレクトリに書き込み権限がない場合は、make installの時はsudoが必要になります。

19
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
17