def _skip_terminal_chars(stream):
    """Skip initial terminal characters (happens when mopper runs via wine)."""
    firstline = stream.readline()
    if '\x1b' in firstline:
        stream.seek(firstline.rfind('\x1b') + 2)
    else:
        stream.seek(0)
