annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31123
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
1 Mercurial can colorizes output from several commands.
5787
b7b22a2ade2e Add colored output to status and qseries commands
Kevin Christen <kevin.christen@gmail.com>
parents:
diff changeset
2
22771
d6274291fac1 color: update description of the extension
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22763
diff changeset
3 For example, the diff command shows additions in green and deletions
d6274291fac1 color: update description of the extension
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22763
diff changeset
4 in red, while the status command shows modified files in magenta. Many
d6274291fac1 color: update description of the extension
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22763
diff changeset
5 other commands have analogous colors. It is possible to customize
d6274291fac1 color: update description of the extension
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22763
diff changeset
6 these colors.
7457
a70fb83cbb9e diff colorization: finish highlighting trailing whitespace
Georg Brandl <georg@python.org>
parents: 7456
diff changeset
7
31123
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
8 To enable color use::
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
9
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
10 [ui]
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
11 color = auto
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
12
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
13 Mode
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
14 ====
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
15
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
16 Mercurial can use various system to display color. The supported modes are
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
17 ``ansi``, ``win32``, and ``terminfo``. See :hg:`help config.color` for details
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
18 about how to control the mode
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
19
22772
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
20 Effects
31123
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
21 =======
22772
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
22
7988
0447939b4b97 color: word-wrap help texts at 70 characters
Martin Geisler <mg@daimi.au.dk>
parents: 7983
diff changeset
23 Other effects in addition to color, like bold and underlined text, are
13987
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
24 also available. By default, the terminfo database is used to find the
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
25 terminal codes used to change color and effect. If terminfo is not
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
26 available, then effects are rendered with the ECMA-48 SGR control
13635
c9ddc39c21b6 color: don't mention internal function in docstring
Martin Geisler <mg@aragost.com>
parents: 13361
diff changeset
27 function (aka ANSI escape codes).
5787
b7b22a2ade2e Add colored output to status and qseries commands
Kevin Christen <kevin.christen@gmail.com>
parents:
diff changeset
28
22772
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
29 The available effects in terminfo mode are 'blink', 'bold', 'dim',
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
30 'inverse', 'invisible', 'italic', 'standout', and 'underline'; in
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
31 ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
32 'underline'. How each is rendered depends on the terminal emulator.
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
33 Some may not be available for a given terminal type, and will be
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
34 silently ignored.
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
35
30176
9f41b66cffc0 color: add some documentation for custom terminfo codes
Danek Duvall <danek.duvall@oracle.com>
parents: 30175
diff changeset
36 If the terminfo entry for your terminal is missing codes for an effect
9f41b66cffc0 color: add some documentation for custom terminfo codes
Danek Duvall <danek.duvall@oracle.com>
parents: 30175
diff changeset
37 or has the wrong codes, you can add or override those codes in your
9f41b66cffc0 color: add some documentation for custom terminfo codes
Danek Duvall <danek.duvall@oracle.com>
parents: 30175
diff changeset
38 configuration::
9f41b66cffc0 color: add some documentation for custom terminfo codes
Danek Duvall <danek.duvall@oracle.com>
parents: 30175
diff changeset
39
9f41b66cffc0 color: add some documentation for custom terminfo codes
Danek Duvall <danek.duvall@oracle.com>
parents: 30175
diff changeset
40 [color]
9f41b66cffc0 color: add some documentation for custom terminfo codes
Danek Duvall <danek.duvall@oracle.com>
parents: 30175
diff changeset
41 terminfo.dim = \E[2m
9f41b66cffc0 color: add some documentation for custom terminfo codes
Danek Duvall <danek.duvall@oracle.com>
parents: 30175
diff changeset
42
9f41b66cffc0 color: add some documentation for custom terminfo codes
Danek Duvall <danek.duvall@oracle.com>
parents: 30175
diff changeset
43 where '\E' is substituted with an escape character.
9f41b66cffc0 color: add some documentation for custom terminfo codes
Danek Duvall <danek.duvall@oracle.com>
parents: 30175
diff changeset
44
22772
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
45 Labels
31123
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
46 ======
22772
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
47
22462
fbd67cf34799 color: document that labels are used for colorizing text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 21991
diff changeset
48 Text receives color effects depending on the labels that it has. Many
fbd67cf34799 color: document that labels are used for colorizing text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 21991
diff changeset
49 default Mercurial commands emit labelled text. You can also define
fbd67cf34799 color: document that labels are used for colorizing text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 21991
diff changeset
50 your own labels in templates using the label function, see :hg:`help
fbd67cf34799 color: document that labels are used for colorizing text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 21991
diff changeset
51 templates`. A single portion of text may have more than one label. In
fbd67cf34799 color: document that labels are used for colorizing text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 21991
diff changeset
52 that case, effects given to the last label will override any other
fbd67cf34799 color: document that labels are used for colorizing text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 21991
diff changeset
53 effects. This includes the special "none" effect, which nullifies
fbd67cf34799 color: document that labels are used for colorizing text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 21991
diff changeset
54 other effects.
fbd67cf34799 color: document that labels are used for colorizing text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 21991
diff changeset
55
22463
1c4ae0f6a30f color: enable debug option to show labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22462
diff changeset
56 Labels are normally invisible. In order to see these labels and their
22711
60ac52a21512 color: update docstring for debug option
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22710
diff changeset
57 position in the text, use the global --color=debug option. The same
60ac52a21512 color: update docstring for debug option
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22710
diff changeset
58 anchor text may be associated to multiple labels, e.g.
22463
1c4ae0f6a30f color: enable debug option to show labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22462
diff changeset
59
22711
60ac52a21512 color: update docstring for debug option
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22710
diff changeset
60 [log.changeset changeset.secret|changeset: 22611:6f0a53c8f587]
22463
1c4ae0f6a30f color: enable debug option to show labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22462
diff changeset
61
22462
fbd67cf34799 color: document that labels are used for colorizing text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 21991
diff changeset
62 The following are the default effects for some default labels. Default
fbd67cf34799 color: document that labels are used for colorizing text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 21991
diff changeset
63 effects may be overridden from your configuration file::
5787
b7b22a2ade2e Add colored output to status and qseries commands
Kevin Christen <kevin.christen@gmail.com>
parents:
diff changeset
64
9206
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
65 [color]
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
66 status.modified = blue bold underline red_background
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
67 status.added = green bold
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
68 status.removed = red bold blue_background
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
69 status.deleted = cyan bold underline
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
70 status.unknown = magenta bold underline
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
71 status.ignored = black bold
5787
b7b22a2ade2e Add colored output to status and qseries commands
Kevin Christen <kevin.christen@gmail.com>
parents:
diff changeset
72
9206
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
73 # 'none' turns off all effects
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
74 status.clean = none
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
75 status.copied = none
5787
b7b22a2ade2e Add colored output to status and qseries commands
Kevin Christen <kevin.christen@gmail.com>
parents:
diff changeset
76
9206
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
77 qseries.applied = blue bold underline
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
78 qseries.unapplied = black bold
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
79 qseries.missing = red bold
7456
79eb16db5e4a color: diff colorization
Brodie Rao <me+hg@dackz.net>
parents: 7455
diff changeset
80
9206
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
81 diff.diffline = bold
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
82 diff.extended = cyan bold
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
83 diff.file_a = red bold
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
84 diff.file_b = green bold
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
85 diff.hunk = magenta
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
86 diff.deleted = red
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
87 diff.inserted = green
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
88 diff.changed = white
22710
b07fd3ac8882 color: document the possibility to colourise tabs in diffs
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22465
diff changeset
89 diff.tab =
9206
c1a1b49221e3 color: use reST syntax for literal block
Martin Geisler <mg@lazybytes.net>
parents: 9057
diff changeset
90 diff.trailingwhitespace = bold red_background
10046
0c23b0b3516b color: Add support for bookmarks
David Soria Parra <dsp@php.net>
parents: 10045
diff changeset
91
22465
f8e2aebbb24c color: document that changeset phases have labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22464
diff changeset
92 # Blank so it inherits the style of the surrounding label
f8e2aebbb24c color: document that changeset phases have labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22464
diff changeset
93 changeset.public =
f8e2aebbb24c color: document that changeset phases have labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22464
diff changeset
94 changeset.draft =
f8e2aebbb24c color: document that changeset phases have labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22464
diff changeset
95 changeset.secret =
f8e2aebbb24c color: document that changeset phases have labels
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22464
diff changeset
96
10223
51421ab573de color: colorize output of hg resolve -l
Georg Brandl <georg@python.org>
parents: 10222
diff changeset
97 resolve.unresolved = red bold
51421ab573de color: colorize output of hg resolve -l
Georg Brandl <georg@python.org>
parents: 10222
diff changeset
98 resolve.resolved = green bold
51421ab573de color: colorize output of hg resolve -l
Georg Brandl <georg@python.org>
parents: 10222
diff changeset
99
25347
ceec79b5657a bookmarks: name label for active bookmark correctly
Ryan McElroy <rmcelroy@fb.com>
parents: 25186
diff changeset
100 bookmarks.active = green
10870
a4944b430417 color: add support for Windows consoles
Steve Borho <steve@borho.org>
parents: 10869
diff changeset
101
11969
52ec5c813723 color: enable branches support
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents: 11750
diff changeset
102 branches.active = none
52ec5c813723 color: enable branches support
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents: 11750
diff changeset
103 branches.closed = black bold
52ec5c813723 color: enable branches support
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents: 11750
diff changeset
104 branches.current = green
52ec5c813723 color: enable branches support
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents: 11750
diff changeset
105 branches.inactive = none
52ec5c813723 color: enable branches support
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents: 11750
diff changeset
106
15048
2f0a3977c939 color: add styles for tags
Marc Simpson <marc@0branch.com>
parents: 14989
diff changeset
107 tags.normal = green
2f0a3977c939 color: add styles for tags
Marc Simpson <marc@0branch.com>
parents: 14989
diff changeset
108 tags.local = black bold
2f0a3977c939 color: add styles for tags
Marc Simpson <marc@0branch.com>
parents: 14989
diff changeset
109
19214
0250047a365e summary: indicate if a rebase is underway
Bryan O'Sullivan <bryano@fb.com>
parents: 19073
diff changeset
110 rebase.rebased = blue
0250047a365e summary: indicate if a rebase is underway
Bryan O'Sullivan <bryano@fb.com>
parents: 19073
diff changeset
111 rebase.remaining = red bold
0250047a365e summary: indicate if a rebase is underway
Bryan O'Sullivan <bryano@fb.com>
parents: 19073
diff changeset
112
19854
49d4919d21c2 shelve: add a shelve extension to save/restore working changes
David Soria Parra <dsp@experimentalworks.net>
parents: 19298
diff changeset
113 shelve.age = cyan
49d4919d21c2 shelve: add a shelve extension to save/restore working changes
David Soria Parra <dsp@experimentalworks.net>
parents: 19298
diff changeset
114 shelve.newest = green bold
49d4919d21c2 shelve: add a shelve extension to save/restore working changes
David Soria Parra <dsp@experimentalworks.net>
parents: 19298
diff changeset
115 shelve.name = blue bold
49d4919d21c2 shelve: add a shelve extension to save/restore working changes
David Soria Parra <dsp@experimentalworks.net>
parents: 19298
diff changeset
116
19215
f184fe1e2ac5 summary: add a histedit hook
Bryan O'Sullivan <bryano@fb.com>
parents: 19214
diff changeset
117 histedit.remaining = red bold
f184fe1e2ac5 summary: add a histedit hook
Bryan O'Sullivan <bryano@fb.com>
parents: 19214
diff changeset
118
22772
b186b3ef4b54 color: reorganise and sectionify the help text
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22771
diff changeset
119 Custom colors
31123
df0a0734304a color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 31120
diff changeset
120 =============
14769
9adce4b38ed1 color: for the sake of "less -R", default to ansi in auto mode (issue2792)
Brodie Rao <brodie@bitheap.org>
parents: 14768
diff changeset
121
13987
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
122 Because there are only eight standard colors, this module allows you
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
123 to define color names for other color slots which might be available
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
124 for your terminal type, assuming terminfo mode. For instance::
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
125
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
126 color.brightblue = 12
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
127 color.pink = 207
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
128 color.orange = 202
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
129
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
130 to set 'brightblue' to color slot 12 (useful for 16 color terminals
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
131 that have brighter colors defined in the upper eight) and, 'pink' and
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
132 'orange' to colors in 256-color xterm's default color cube. These
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
133 defined colors may then be used as any of the pre-defined eight,
e0f07847f8de color: add support for terminfo-based attributes and color
Danek Duvall <duvall@comfychair.org>
parents: 13919
diff changeset
134 including appending '_background' to set the background to that color.