[PATCH stable] color: tweak behavior of ui.color config knob

Kevin Bullock kbullock+mercurial at ringworld.org
Tue May 2 12:09:56 EDT 2017


> On May 2, 2017, at 09:55, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
> 
> Let me try to clarify. We are talking about possible surprising corner cases here.
> 
> The current implementation "suffer" from one surprise:
> 
> 1) ui.color=True is actually "always color"

To me, this is a pretty bad situation. In 4.1 and earlier, turning on color by enabling the color extension and then cat'ing output to a file does the right thing (strips colors). Now if I enable color by setting ui.color=True, I get horrible escape codes in my output.

> The proposed patch "suffer" from two surprises:
> 
> 2) ui.color=always is actually "--color=auto" not "--color=always"

This is undesirable, but is less of a problem. Before 4.2 we don't have a config option at all that means the same as --color=always, and we can adjust documentation not to mention the possibility (yet).

> 3) '--color=auto works', but 'ui.color=auto' doesn not (= off)

That's a bigger issue, and if we can fix this in a V2 (and update docs) I'd be happy with the patch.

What I'd ideally like is to cut a release in which ui.color is approximately a strict boolean, where true==auto and false==never. Then we can add the always/auto/never behavior to the config knob in a later release.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list