Only use ANSI terminal escapes if output is a TTY

Bug #1097961 reported by Jeremy Stanley
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
git-review
Triaged
Low
Unassigned

Bug Description

Commands like 'git review -l' which colorize output should only do so when that output is destined for a terminal. If the output is a file or pipe, only plain text should be generated. Bonus points for a --no-color or similar command-line option, for people who aren't fond of it even when it is going to their terminal.

Revision history for this message
Marcin Cieślak (saperski) wrote :

Although I did some work on this, I'd be happy to remove color support completely from this feature.

Revision history for this message
Jeremy Stanley (fungi) wrote :

I'm not convinced it's worth the development effort to rip that out, but if someone comes up with a good way to limit it to actual interactive TTYs that would be welcomed (and a bit more correct, especially if done using the TERM envvar to determine whether ANSI color is even supported).

Jeremy Stanley (fungi)
Changed in git-review:
status: New → Triaged
Revision history for this message
Darragh Bailey (dbailey-k) wrote :

Turns out I was already working on part of it, see https://review.openstack.org/#/c/106617

Would need to add the '--no-color' option to it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.