Skip to content

Drop colorama #2986

Closed
Closed

Description

@davidism

We currently depend on Colorama on Windows, which converts ANSI formatting codes to equivalent Windows Console commands. However, on Windows >= 10, both the console host and Terminal app support ANSI:

On Windows 10 and higher, the Windows Console Host is xterm compatible. The Windows Terminal application is also xterm compatible. These terminals support ANSI escape sequences.

Windows 10 reaches end of support on October 25, 2025. We drop Python versions within 6 months of end of life, doing the same for Windows seems reasonable.

The last release of Colorama was October 24, 2022. The year prior, they opened an issue explaining that maintenance was unlikely to move quickly, if it happened at all. This hasn't been updated since 2022 either.

Removing colorama would not break Click running on older versions of Windows. It would cause ANSI to be emitted unless color=False was passed to the context, which is easy enough to do if a project wants to opt-in to supporting older Windows versions.

Activity

  1. added this to the 9.0.0 milestone on Jun 26, 2025
  2. Rowlando13 commented on May 18, 2026

    @Rowlando13
    Member

    May be possible to remove colorama, will have to test extensively on windows 11 on an actual machine.

  3. kdeldycke commented on May 21, 2026

    @kdeldycke
    Collaborator

    May be possible to remove colorama, will have to test extensively on windows 11 on an actual machine.

    We can extend the tests to the windows-11-arm runner as I do for Click Extra. So far both main and stable branches of Click seems to work: https://github.com/kdeldycke/click-extra/actions/runs/26231172013/job/77192017687

  4. added
    windowsWindows-specific behavior
    test runnerCliRunner and Click's test utilities feature
    on May 21, 2026
  5. changed the title [-]drop colorama[/-] [+]Drop `colorama`[/+] on May 21, 2026
  6. davidism commented on May 21, 2026

    @davidism
    MemberAuthor

    I have a feeling the tests will continue to work, I'm not sure colorama's effects would be picked up by the test runner, it modifies the console.

  7. kdeldycke commented on May 21, 2026

    @kdeldycke
    Collaborator

    I have a feeling the tests will continue to work, I'm not sure colorama's effects would be picked up by the test runner, it modifies the console.

    I patched the CLIRunner in Click Extra to force coloring even if the tests are run in a non-interactive terminal (i.e. the whole is_atty auto-detection machinery). This helped me test the ANSI rendering of my coloring help screens for 4 years. Had to fix a lot of edge-cases but it's quite solid now. I can try porting a lightweight version of that in the future.

    For details: https://github.com/kdeldycke/click-extra/blob/d46781f0940e45eb34c4111a828b94300fb87fb8/click_extra/testing.py#L203-L216

  8. davidism commented on May 21, 2026

    @davidism
    MemberAuthor

    Right, that's fine for our ANSI color output, but colorama and the Windows console works at a different layer. I have a Windows machine right now, so I'll be able to manually test removing it if no one else gets there first.

  9. davidism commented on May 23, 2026

    @davidism
    MemberAuthor

    Seems to work fine, PR coming soon.

  10. added
    help outputHelp text formatting, layout, and --help rendering
    on May 23, 2026
  11. modified the milestones: 9.0.0, 8.5.0 on May 23, 2026
  12. kdeldycke commented on Jul 8, 2026

    @kdeldycke
    Collaborator

    Also see related documentation updates at: #3671

  13. locked as resolved and limited conversation to collaborators on Jul 24, 2026
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

    help outputHelp text formatting, layout, and --help renderingtest runnerCliRunner and Click's test utilities featurewindowsWindows-specific behavior

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions