Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#32694 closed Bug (wontfix)

Colored output detection issue in VS Code on Windows 8.1

Reported by: Thibaud Colas Owned by: nobody
Component: Core (Management commands) Version: 3.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Thibaud Colas)

Apologies if this is a known issue. I searched for references to 'Windows' in the bug tracker and didn't find any that matched. I'm also unsure whether Windows 8.1 support is important to Django or not.

Trying Django 3.2 on a Windows machine in VS Code, I noticed the colored CLI output (https://docs.djangoproject.com/en/3.2/ref/django-admin/#syntax-coloring) doesn't work in the VS Code integrated terminal. This is with Git Bash, and the built-in cmd.exe as far as I can see.

Here is the type of output I'm seeing (Git Bash in this case):

$ python manage.py makemigrations
←[36;1mMigrations for 'blog':←[0m
  ←[1mblog\migrations\0001_initial.py←[0m
    - Create model BlogIndexPage
(.venv)

See the attached screenshot, which shows that colors support works otherwise:

https://code.djangoproject.com/raw-attachment/ticket/32694/gitbash-colored-output.png

For what it's worth I also tried Git Bash and the cmd.exe prompt outside VS Code, and both seemed to work as expected (not showing any colored output).

I also tried installing colorama, and with this installed I get the expected colored output in the VS Code terminal. So the issue seems to be with the detection of whether color codes should be in the output or not.

Attachments (1)

gitbash-colored-output.png (23.8 KB ) - added by Thibaud Colas 4 years ago.

Download all attachments as: .zip

Change History (8)

by Thibaud Colas, 4 years ago

Attachment: gitbash-colored-output.png added

comment:1 by Thibaud Colas, 4 years ago

Description: modified (diff)

comment:2 by Thibaud Colas, 4 years ago

Description: modified (diff)

comment:3 by Thibaud Colas, 4 years ago

Description: modified (diff)

comment:4 by Carlton Gibson, 4 years ago

Resolution: wontfix
Status: newclosed

Hi Thibaud — thanks for the report here.

...Windows 8.1 support...

I also tried installing colorama, and with this installed I get the expected colored output in the VS Code terminal.

So, I'm going to say wontfix here. I don't see that we can (or should) spend time working around this when Windows 8.1 is essentially end of life — last release 7 years ago — and has such small usage.

That colorama solves the issue seems sufficient to me.

Happy if you want to review the Syntax colouring docs for a tweak.

I hope that seems reasonable.

This is with Git Bash, and the built-in cmd.exe...

FWIW I'm a Powershell kind of fella but I rechecked both these on Windows 10 and all looks good.

Last edited 4 years ago by Carlton Gibson (previous) (diff)

comment:5 by GitHub <noreply@…>, 4 years ago

In 4f128fcf:

Refs #32694 -- Clarified when colorama requirement is needed in Windows how-to.

comment:6 by Carlton Gibson <carlton.gibson@…>, 4 years ago

In d716d30a:

[3.2.x] Refs #32694 -- Clarified when colorama requirement is needed in Windows how-to.

Backport of 4f128fcf5dd5099a5ea374a87cad64852a9b62dd from main

comment:7 by Thibaud Colas, 4 years ago

Thank you Carlton, great to confirm this is a Windows 8.1-only issue. Now I just need to work on getting my relatives to update…

Thank you for tweaking the docs as well. It’s nice that there are clear options to either disable color codes, or have them work with the extra package.

Note: See TracTickets for help on using tickets.
Back to Top