     super(msg, s)
   end
 
-  def handle_call(:contents, _from, state(input: input, output: output) = s) do
+  def handle_call(:contents, _from, %StringIO{input: input, output: output} = s) do
     {:reply, {input, output}, s}
   end
 
-  def handle_call(:close, _from, state(input: input, output: output) = s) do
+  def handle_call(:close, _from, %StringIO{input: input, output: output} = s) do
     {:stop, :normal, {:ok, {input, output}}, s}
   end
 

          output = << output :: binary, String.from_char_data!(prompt) :: binary >>
        end

        {result, state(s, input: input, output: output)}
    end
  end



  def init({string, options}) do
    capture_prompt = options[:capture_prompt] || false
    {:ok, %StringIO{input: string, capture_prompt: capture_prompt}}
  end

  def handle_info({:io_request, from, reply_as, req}, s) do
