def _right_align(p_str):
    """
    Returns p_str with content after <TAB> character aligned right.

    Right alignment is done using proper number of spaces calculated from
    'line_width' attribute.
    """
    to_fill = _columns() - len(escape_ansi(p_str))

    if to_fill > 0:
        p_str = re.sub('\t', ' '*to_fill, p_str)
    else:
        p_str = re.sub('\t', ' ', p_str)

    return p_str