Show More
@@ -3,6 +3,7 b'' | |||
|
3 | 3 | Color schemes for exception handling code in IPython. |
|
4 | 4 | """ |
|
5 | 5 | |
|
6 | import os | |
|
6 | 7 | import warnings |
|
7 | 8 | |
|
8 | 9 | #***************************************************************************** |
@@ -155,6 +156,12 b' def exception_colors():' | |||
|
155 | 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 | 166 | return ex_colors |
|
160 | 167 |
@@ -290,6 +290,16 b' class TerminalInteractiveShell(InteractiveShell):' | |||
|
290 | 290 | Token.OutPrompt: '#990000', |
|
291 | 291 | Token.OutPromptNum: '#ff0000 bold', |
|
292 | 292 | }) |
|
293 | ||
|
294 | # Hack: Due to limited color support on the Windows console | |
|
295 | # the prompt colors will be wrong without this | |
|
296 | if os.name == 'nt': | |
|
297 | style_overrides.update({ | |
|
298 | Token.Prompt: '#ansidarkgreen', | |
|
299 | Token.PromptNum: '#ansigreen bold', | |
|
300 | Token.OutPrompt: '#ansidarkred', | |
|
301 | Token.OutPromptNum: '#ansired bold', | |
|
302 | }) | |
|
293 | 303 | elif legacy =='nocolor': |
|
294 | 304 | style_cls=_NoStyle |
|
295 | 305 | style_overrides = {} |
General Comments 0
You need to be logged in to leave comments.
Login now