comparison mercurial/help/color.txt @ 31123:df0a0734304a

color: update main documentation Now that the feature no longer lives in the extension, we document it in the help of the core config. This include the new 'ui.color' option introduced in the previous changesets. As a result the color extensions can now be deprecated. This is a documentation patch only; color is still disabled by default.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 21 Feb 2017 20:04:55 +0100
parents hgext/color.py@c4e8fa2b1c40
children a6865b35a10d
comparison
equal deleted inserted replaced
31122:53a60e95f154 31123:df0a0734304a
1 Mercurial can colorizes output from several commands.
2
3 For example, the diff command shows additions in green and deletions
4 in red, while the status command shows modified files in magenta. Many
5 other commands have analogous colors. It is possible to customize
6 these colors.
7
8 To enable color use::
9
10 [ui]
11 color = auto
12
13 Mode
14 ====
15
16 Mercurial can use various system to display color. The supported modes are
17 ``ansi``, ``win32``, and ``terminfo``. See :hg:`help config.color` for details
18 about how to control the mode
19
20 Effects
21 =======
22
23 Other effects in addition to color, like bold and underlined text, are
24 also available. By default, the terminfo database is used to find the
25 terminal codes used to change color and effect. If terminfo is not
26 available, then effects are rendered with the ECMA-48 SGR control
27 function (aka ANSI escape codes).
28
29 The available effects in terminfo mode are 'blink', 'bold', 'dim',
30 'inverse', 'invisible', 'italic', 'standout', and 'underline'; in
31 ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and
32 'underline'. How each is rendered depends on the terminal emulator.
33 Some may not be available for a given terminal type, and will be
34 silently ignored.
35
36 If the terminfo entry for your terminal is missing codes for an effect
37 or has the wrong codes, you can add or override those codes in your
38 configuration::
39
40 [color]
41 terminfo.dim = \E[2m
42
43 where '\E' is substituted with an escape character.
44
45 Labels
46 ======
47
48 Text receives color effects depending on the labels that it has. Many
49 default Mercurial commands emit labelled text. You can also define
50 your own labels in templates using the label function, see :hg:`help
51 templates`. A single portion of text may have more than one label. In
52 that case, effects given to the last label will override any other
53 effects. This includes the special "none" effect, which nullifies
54 other effects.
55
56 Labels are normally invisible. In order to see these labels and their
57 position in the text, use the global --color=debug option. The same
58 anchor text may be associated to multiple labels, e.g.
59
60 [log.changeset changeset.secret|changeset: 22611:6f0a53c8f587]
61
62 The following are the default effects for some default labels. Default
63 effects may be overridden from your configuration file::
64
65 [color]
66 status.modified = blue bold underline red_background
67 status.added = green bold
68 status.removed = red bold blue_background
69 status.deleted = cyan bold underline
70 status.unknown = magenta bold underline
71 status.ignored = black bold
72
73 # 'none' turns off all effects
74 status.clean = none
75 status.copied = none
76
77 qseries.applied = blue bold underline
78 qseries.unapplied = black bold
79 qseries.missing = red bold
80
81 diff.diffline = bold
82 diff.extended = cyan bold
83 diff.file_a = red bold
84 diff.file_b = green bold
85 diff.hunk = magenta
86 diff.deleted = red
87 diff.inserted = green
88 diff.changed = white
89 diff.tab =
90 diff.trailingwhitespace = bold red_background
91
92 # Blank so it inherits the style of the surrounding label
93 changeset.public =
94 changeset.draft =
95 changeset.secret =
96
97 resolve.unresolved = red bold
98 resolve.resolved = green bold
99
100 bookmarks.active = green
101
102 branches.active = none
103 branches.closed = black bold
104 branches.current = green
105 branches.inactive = none
106
107 tags.normal = green
108 tags.local = black bold
109
110 rebase.rebased = blue
111 rebase.remaining = red bold
112
113 shelve.age = cyan
114 shelve.newest = green bold
115 shelve.name = blue bold
116
117 histedit.remaining = red bold
118
119 Custom colors
120 =============
121
122 Because there are only eight standard colors, this module allows you
123 to define color names for other color slots which might be available
124 for your terminal type, assuming terminfo mode. For instance::
125
126 color.brightblue = 12
127 color.pink = 207
128 color.orange = 202
129
130 to set 'brightblue' to color slot 12 (useful for 16 color terminals
131 that have brighter colors defined in the upper eight) and, 'pink' and
132 'orange' to colors in 256-color xterm's default color cube. These
133 defined colors may then be used as any of the pre-defined eight,
134 including appending '_background' to set the background to that color.