@@ -19,7 +19,8 @@ defmodule IEx.CLI do
19
19
else
20
20
:user . start
21
21
IO . puts "Warning: could not run smart terminal, falling back to dumb one"
22
- IEx . start ( [ ] , fn -> :elixir . start_cli end )
22
+ config = [ dot_iex_path: find_dot_iex ( :init . get_plain_arguments ) ]
23
+ IEx . start ( config , fn -> :elixir . start_cli end )
23
24
end
24
25
end
25
26
@@ -37,12 +38,15 @@ defmodule IEx.CLI do
37
38
end
38
39
39
40
defp tty do
41
+ plain_args = :init . get_plain_arguments
42
+
43
+ config = [ dot_iex_path: find_dot_iex ( plain_args ) ]
40
44
function = fn ->
41
- IEx . start ( [ ] , fn -> :elixir . start_cli end )
45
+ IEx . start ( config , fn -> :elixir . start_cli end )
42
46
end
43
47
44
48
args =
45
- if remote = get_remsh ( :init . get_plain_arguments ) do
49
+ if remote = get_remsh ( plain_args ) do
46
50
unless is_alive do
47
51
function = fn ->
48
52
IO . puts ( :stderr , "In order to use --remsh, you need to name the current node using --name or --sname. Aborting..." )
@@ -60,6 +64,10 @@ defmodule IEx.CLI do
60
64
:user_drv . start ( [ :"tty_sl -c -e" , args ] )
61
65
end
62
66
67
+ defp find_dot_iex ( [ '--dot-iex' , h | _ ] ) , do: :unicode . characters_to_binary ( h )
68
+ defp find_dot_iex ( [ _ | t ] ) , do: find_dot_iex ( t )
69
+ defp find_dot_iex ( [ ] ) , do: nil
70
+
63
71
defp get_remsh ( [ '--remsh' , h | _ ] ) , do: list_to_atom ( h )
64
72
defp get_remsh ( [ _ | t ] ) , do: get_remsh ( t )
65
73
defp get_remsh ( [ ] ) , do: nil
0 commit comments