Skip to content

windows 10(ver 1607) cmd.exe ansi color text not work. #46

Open

Description

@sunose

windows 10 (v1607) with python 3.5.1 and python 3.5.2 ,pyreadline ansi color text output in cmd.exe(windws 10.0.14393]),not work,ansi escape code control string just output trash charactor.
pyreadline

Activity

  1. RDCH106 commented on Oct 5, 2016

    @RDCH106

    Try this Fix:

    RDCH106/SimplePythonTools@ca6def5

    You can apply the Fix in the main file of your program where you call the library or the straightforward way is fixing library in the following file:

    https://github.com/pyreadline/pyreadline/blob/master/pyreadline/console/ansi.py

    The problem is caused because after the Windows Anniversary update, CMD of Windows does not support ANSI color by default and it must be activated using ctypes to enable ENABLE_VIRTUAL_TERMINAL_PROCESSING flag.

    Here's the Gist with the necessary code:

    https://gist.github.com/RDCH106/6562cc7136b30a5c59628501d87906f7

  2. eabase commented on Jan 14, 2022

    @eabase

    To enable colors in the Python REPL.
    import os; os.system('')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions