import unicodedata


def get_terminal_width(string):
    """
    Get the terminal width of a string

    This is not the length in characters, but the width that the characters
    will be displayed on a terminal, compensating for double-wide characters.
    """

    widths = {"W": 2, "F": 2}

    return sum(widths.get(unicodedata.east_asian_width(c), 1) for c in string)