Show More
@@ -3,6 +3,7 b'' | |||||
3 | Color schemes for exception handling code in IPython. |
|
3 | Color schemes for exception handling code in IPython. | |
4 | """ |
|
4 | """ | |
5 |
|
5 | |||
|
6 | import os | |||
6 | import warnings |
|
7 | import warnings | |
7 |
|
8 | |||
8 | #***************************************************************************** |
|
9 | #***************************************************************************** | |
@@ -155,6 +156,12 b' def exception_colors():' | |||||
155 | Normal = C.Normal, |
|
156 | Normal = C.Normal, | |
156 | )) |
|
157 | )) | |
157 |
|
158 | |||
|
159 | # Hack: the 'neutral' colours are not very visible on a dark background on | |||
|
160 | # Windows. Since Windows command prompts have a dark background by default, and | |||
|
161 | # relatively few users are likely to alter that, we will use the 'Linux' colours, | |||
|
162 | # designed for a dark background, as the default on Windows. | |||
|
163 | if os.name == "nt": | |||
|
164 | ex_colors.add_scheme(ex_colors['Linux'].copy('Neutral')) | |||
158 |
|
165 | |||
159 | return ex_colors |
|
166 | return ex_colors | |
160 |
|
167 |
@@ -286,6 +286,16 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
286 | Token.OutPrompt: '#990000', |
|
286 | Token.OutPrompt: '#990000', | |
287 | Token.OutPromptNum: '#ff0000 bold', |
|
287 | Token.OutPromptNum: '#ff0000 bold', | |
288 | }) |
|
288 | }) | |
|
289 | ||||
|
290 | # Hack: Due to limited color support on the Windows console | |||
|
291 | # the prompt colors will be wrong without this | |||
|
292 | if os.name == 'nt': | |||
|
293 | style_overrides.update({ | |||
|
294 | Token.Prompt: '#ansidarkgreen', | |||
|
295 | Token.PromptNum: '#ansigreen bold', | |||
|
296 | Token.OutPrompt: '#ansidarkred', | |||
|
297 | Token.OutPromptNum: '#ansired bold', | |||
|
298 | }) | |||
289 | elif legacy =='nocolor': |
|
299 | elif legacy =='nocolor': | |
290 | style_cls=_NoStyle |
|
300 | style_cls=_NoStyle | |
291 | style_overrides = {} |
|
301 | style_overrides = {} |
General Comments 0
You need to be logged in to leave comments.
Login now