Skip to content

[BUG] GitHub Actions FORCE_COLOR with console.status #3632

@ocervell

Description

@ocervell

I used to have console defined like this:

console = Console(stderr=True, color_system='truecolor')

and things like:

with console.status('Installing tools ...'):
  # pass

would work properly on GitHub actions, i.e console.print would give me colored output and console.status messages would be hidden since I am on CI terminal.

After removing color_system='truecolor', I tried setting FORCE_COLOR = 1 env variable in GitHub actions, and mostly things would work smoothly except for the status messages which would print on everyline like:

⠦  Installing Go...
Resolving dl.google.com (dl.google.com)... 64.233.180.91, 64.233.180.190, 
64.233.180.93, ...
⠦  Installing Go...
⠦  Installing Go...
Connecting to dl.google.com (dl.google.com)|64.233.180.91|:443... connected.
⠦  Installing Go...
⠧  Installing Go...
HTTP request sent, awaiting response... 200 OK
⠇  Installing Go...
Length: 68988925 (66M) [application/x-gzip]
⠇  Installing Go...
Saving to: ‘go1.22.0.linux-amd64.tar.gz’
⠇  Installing Go...
     0K .......... .......... .......... .......... ..........  0% 4.65M 14s
⠇  Installing Go...
    50K .......... .......... .......... .......... ..........  0% 8.99M 11s
⠇  Installing Go...
   100K .......... .......... .......... .......... ..........  0% 10.8M 9s
⠇  Installing Go...
   150K .......... .......... .......... .......... ..........  0% 23.9M 8s
⠇  Installing Go...
   200K .......... .......... .......... .......... ..........  0% 26.3M 7s
⠇  Installing Go...
   250K .......... .......... .......... .......... ..........  0% 21.8M 6s
⠇  Installing Go...
   300K .......... .......... .......... .......... ..........  0% 29.5M 5s
⠇  Installing Go...
   350K .......... .......... .......... .......... ..........  0% 41.1M 5s
⠇  Installing Go...
   400K .......... .......... .......... .......... ..........  0% 46.1M 5s
⠇  Installing Go...
   450K .......... .......... .......... .......... ..........  0% 47.3M 4s
⠇  Installing Go...
   500K .......... .......... .......... .......... ..........  0% 36.1M 4s
⠇  Installing Go...
   550K .......... .......... .......... .......... ..........  0% 71.1M 4s
⠇  Installing Go...
   600K .......... .......... .......... .......... ..........  0% 74.1M 4s
⠇  Installing Go...
   650K .......... .......... .......... .......... ..........  1% 73.4M 3s
⠇  Installing Go...
   700K .......... .......... .......... .......... ..........  1% 61.2M 3s
⠇  Installing Go...
   750K .......... .......... .......... .......... ..........  1%  143M 3s
⠇  Installing Go...
   800K .......... .......... .......... .......... ..........  1% 55.8M 3s
⠇  Installing Go...
   850K .......... .......... .......... .......... ..........  1%  155M 3s
⠇  Installing Go...
   900K .......... .......... .......... .......... ..........  1% 71.4M 3s
⠇  Installing Go...
   950K .......... .......... .......... .......... ..........  1% 44.1M 3s

Any idea how I can fix this without explicitely having to set color_system ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions