# File lib/rbreadline.rb, line 5680
  def _rl_update_final()
    full_lines = false
    # If the cursor is the only thing on an otherwise-blank last line,
    #   compensate so we don't print an extra CRLF.
    if (@_rl_vis_botlin && @_rl_last_c_pos == 0 &&
        @visible_line[@vis_lbreaks[@_rl_vis_botlin],1] == 0.chr )
      @_rl_vis_botlin-=1
      full_lines = true
    end
    _rl_move_vert(@_rl_vis_botlin)
    # If we've wrapped lines, remove the final xterm line-wrap flag.
    if (full_lines && @_rl_term_autowrap && (vis_llen(@_rl_vis_botlin) == @_rl_screenwidth))
      last_line = @visible_line[@vis_lbreaks[@_rl_vis_botlin]..-1]
      @cpos_buffer_position = -1 # don't know where we are in buffer
      _rl_move_cursor_relative(@_rl_screenwidth - 1, last_line)   # XXX
      _rl_clear_to_eol(0)
      @rl_outstream.write(last_line[@_rl_screenwidth - 1,1])
    end
    @_rl_vis_botlin = 0
    rl_crlf()
    @rl_outstream.flush
    @rl_display_fixed = true if !@rl_display_fixed
  end