     Elixir.IEx.Config.new(io: io, binding: binding, scope: scope)
   end
 
-  defp do_loop(config) do
+  defp do_loop(config, history // []) do
     io = config.io
 
     config  = config.increment_counter

  code cache, the instructions counter and needs to
  return a list with the new characters inserted.
  """
  def get(cache, _count) do
    prompt = case cache do
      [] -> "iex> "
      _ -> "...> "
    end
    :unicode.characters_to_list(IO.gets(prompt))

          stacktrace = System.stacktrace
          io.error "** (#{inspect exception.__record__(:name)}) #{exception.message}"
          print_stacktrace io, stacktrace
          {config.cache(''), history}
      catch
        kind, error ->
          stacktrace = System.stacktrace
          io.error "** (#{kind}) #{inspect(error)}"
          print_stacktrace io, stacktrace
          {config.cache(''), history}
      end

    do_loop(new_config, history)
  end

  defp print_stacktrace(io, stacktrace) do
