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 |
@@ -286,6 +286,16 b' class TerminalInteractiveShell(InteractiveShell):' | |||
|
286 | 286 | Token.OutPrompt: '#990000', |
|
287 | 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 | 299 | elif legacy =='nocolor': |
|
290 | 300 | style_cls=_NoStyle |
|
291 | 301 | style_overrides = {} |
General Comments 0
You need to be logged in to leave comments.
Login now