Opened 6 years ago

Closed 6 years ago

#17222 closed New feature (wontfix)

Let `` learn --colour/--color option to control if colouring output is wanted by user

Reported by: rabio Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


It will be nice if could understand --colour/--color options like grep do for example (i.e always / never / guess).


  1. It may be still reasonable to force to output colour escape sequences even when output is not send to a tty (now escape sequences for colour are supresed in this case). For example, this may happen when its output is redirected to less -R or tail.
  1. Even when switching colours off may be achieved now by setting DJANGO_COLORS=nocolor environment variable (or to any palette name not known to django.utils.termcolors), it is not obvious way to achieve this and it is not always as easy to set / change environment variable as it is to run command with additional option.
  1. See also #17221 for additional rationale as this enhancement may provide temporary workaround for it.

Change History (2)

comment:1 Changed 6 years ago by Aymeric Augustin

Triage Stage: UnreviewedDesign decision needed

Like #17221, I'm reluctant to accept this ticket, because terminal coloring is just a small nicety, not a core feature of Django. I'm against introducing too many options for or too much code dedicated to support terminal coloring.

If you uploaded a patch implementing this feature cleanly, it would be a strong argument in favor your request. Marking as DDN for now.

Before working on a patch, make sure you read #12112, where the idea of a --color switch was discussed.

comment:2 Changed 6 years ago by Adrian Holovaty

Resolution: wontfix
Status: newclosed

I agree with aaugustin's reluctance. It's not worth adding this code to the framework. Marking as wontfix.

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