LoginSignup
15
1

More than 1 year has passed since last update.

Elixirの対話シェル(IEx)を起動したときにプロンプト(iex> )の上に出るやつはどこからきているのか気になりませんか?

❯ iex
Erlang/OTP 25 [erts-13.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace]

Interactive Elixir (1.14.0) - press Ctrl+C to exit (type h() ENTER for help)
iex>

iex> 上に2行印字されています。

1. "Erlang/OTP..."

これはErlangの対話シェルにより印字されているようです。

試しにErlangの対話シェルを起動してみます。

❯ erl
Erlang/OTP 25 [erts-13.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Eshell V13.1  (abort with ^G)
1>

出ました。詳しくは(まだ)知りません。

iexコマンドの実行ファイルの最後の行でelixirコマンドが実行される際にErlangerlコマンドの引数が--erlに渡されています。

  • -noshell: Erlangの対話シェルを起動せずにErlangランライムを起動
  • -user: Erlang userをセットする 
exec "$SCRIPT_PATH"/elixir --no-halt --erl "-noshell -user Elixir.IEx.CLI" +iex "$@"

2. "Interactive Elixir..."

これはElixirIEx.Server.run/1から呼ばれるIEx.Server.run_without_registration/2で印字されています。

ご参考までに

15
1
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
15
1