Show More
@@ -140,6 +140,17 b" emit codes that less doesn't understand." | |||||
140 | either using ansi mode (or auto mode), or by using less -r (which will |
|
140 | either using ansi mode (or auto mode), or by using less -r (which will | |
141 | pass through all terminal control codes, not just color control |
|
141 | pass through all terminal control codes, not just color control | |
142 | codes). |
|
142 | codes). | |
|
143 | ||||
|
144 | On some systems (such as MSYS in Windows), the terminal may support | |||
|
145 | a different color mode than the pager (activated via the "pager" | |||
|
146 | extension). It is possible to define separate modes depending on whether | |||
|
147 | the pager is active:: | |||
|
148 | ||||
|
149 | [color] | |||
|
150 | mode = auto | |||
|
151 | pagermode = ansi | |||
|
152 | ||||
|
153 | If ``pagermode`` is not defined, the ``mode`` will be used. | |||
143 | ''' |
|
154 | ''' | |
144 |
|
155 | |||
145 | import os |
|
156 | import os | |
@@ -213,6 +224,11 b' def _modesetup(ui, coloropt):' | |||||
213 | formatted = always or (os.environ.get('TERM') != 'dumb' and ui.formatted()) |
|
224 | formatted = always or (os.environ.get('TERM') != 'dumb' and ui.formatted()) | |
214 |
|
225 | |||
215 | mode = ui.config('color', 'mode', 'auto') |
|
226 | mode = ui.config('color', 'mode', 'auto') | |
|
227 | ||||
|
228 | # If pager is active, color.pagermode overrides color.mode. | |||
|
229 | if getattr(ui, 'pageractive', False): | |||
|
230 | mode = ui.config('color', 'pagermode', mode) | |||
|
231 | ||||
216 | realmode = mode |
|
232 | realmode = mode | |
217 | if mode == 'auto': |
|
233 | if mode == 'auto': | |
218 | if os.name == 'nt': |
|
234 | if os.name == 'nt': |
General Comments 0
You need to be logged in to leave comments.
Login now