Opened 3 years ago

Closed 3 years ago

#17222 closed New feature (wontfix)

Let `manage.py` 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

Description

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

Rationale

  1. It may be still reasonable to force manage.py 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 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design 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 django-admin.py 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 3 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

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