Opened 13 years ago
Closed 13 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: | dev |
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
- It may be still reasonable to force
manage.py
to output colour escape sequences even when output is not send to atty
(now escape sequences for colour are supresed in this case). For example, this may happen when its output is redirected toless -R
ortail
.
- 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.
- See also #17221 for additional rationale as this enhancement may provide temporary workaround for it.
Change History (2)
comment:1 by , 13 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 13 years ago
Resolution: | → wontfix |
---|---|
Status: | new → 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.
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.