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