def format_traceback(text):
    """We format tracebacks using the default stderr color (usually red)
    except that lines with code are shown in the default color (usually black).
    """
    lines = text.split("\n")
    if lines[-2].startswith("SyntaxError:"):
        if lines[2].strip().startswith("File"):
            lines = lines[3:]  # Remove everything before syntax error
        else:
            lines = lines[1:]  # Remove file name
    new_lines = []
    for line in lines:
        if line.startswith("    "):
            new_lines.append((line, "default"))
        elif line:
            new_lines.append((line, "stderr"))
        new_lines.append(("\n", "default"))
    return new_lines