Thanks to visit codestin.com
Credit goes to github.com

Skip to content

24 bits ANSI codes are wrongly converted instead of being stripped #217

@Delgan

Description

@Delgan

Hi.

Some terminals support 24-bit ANSI colors (aka "true colors") in the form ESC[ 38;2;<r>;<g>;<b>.

This code:

import colorama
colorama.init()
print("\x1b[38;2;166;226;46m{}\x1b[0m".format("Foo"))

Result on Windows:

1552843793-screenshot

Result on a true colors terminal:

1552844028-screenshot

I guess there may be an issue within the colorama regex in charge of parsing color codes. On Windows, this should be stripped, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions