         loop(state)
 
       {:done, ^server} ->
+        :ok
+
+      {:done, ^ref} ->
         :ok
     end
   end


  """
  def init(command, server, leader, opts) do
    old_leader = Process.group_leader()
    Process.group_leader(self(), leader)

    old_server = Process.get(:iex_server)
    Process.put(:iex_server, server)

    evaluator = Process.get(:iex_evaluator)
    Process.put(:iex_evaluator, command)

    state = loop_state(server, IEx.History.init(), opts)
    command == :ack && :proc_lib.init_ack(self())

    try do

        do: var_name
  end

  defp loop_state(ref, server, history, opts) do
    env = opts[:env] || :elixir.env_for_eval(file: "iex")
    env = %{env | prematch_vars: :apply}
    {_, _, env} = :elixir.eval_quoted(quote(do: import(IEx.Helpers)), [], env)
