# File lib/rbreadline.rb, line 3930
  def readline_internal_setup()
    @_rl_in_stream = @rl_instream
    @_rl_out_stream = @rl_outstream

    if (@rl_startup_hook)
      send(@rl_startup_hook)
    end

    # If we're not echoing, we still want to at least print a prompt, because
    #   rl_redisplay will not do it for us.  If the calling application has a
    #   custom redisplay function, though, let that function handle it.
    if (!@readline_echoing_p && @rl_redisplay_function == :rl_redisplay)
      if (@rl_prompt && !@rl_already_prompted)
        nprompt = _rl_strip_prompt(@rl_prompt)
        @_rl_out_stream.write(nprompt)
        @_rl_out_stream.flush
      end
    else
      if (@rl_prompt && @rl_already_prompted)
        rl_on_new_line_with_prompt()
      else
        rl_on_new_line()
      end
      send(@rl_redisplay_function)
    end

    if (@rl_editing_mode == @vi_mode)
      rl_vi_insertion_mode(1, 'i')
    end
    if (@rl_pre_input_hook)
      send(@rl_pre_input_hook)
    end
  end