# File lib/rbreadline.rb, line 8117
  def _rl_make_prompt_for_search(pchar)
    rl_save_prompt()

    # We've saved the prompt, and can do anything with the various prompt
    #   strings we need before they're restored.  We want the unexpanded
    #   portion of the prompt string after any final newline.
    _p = @rl_prompt ? @rl_prompt.rindex("\n") : nil
    if _p.nil?
      len = (@rl_prompt && @rl_prompt.length>0 ) ? @rl_prompt.length : 0
      if (len>0)
        pmt = @rl_prompt.dup
      else
        pmt = ''
      end
      pmt << pchar
    else
      _p+=1
      pmt = @rl_prompt[_p..-1]
      pmt << pchar
    end

    # will be overwritten by expand_prompt, called from rl_message
    @prompt_physical_chars = @saved_physical_chars + 1
    pmt
  end