##// END OF EJS Templates
Backport PR #10260: Fix the rest of the colors used on Windows so they are more visible...
Matthias Bussonnier -
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
@@ -290,6 +290,16 b' class TerminalInteractiveShell(InteractiveShell):'
290 Token.OutPrompt: '#990000',
290 Token.OutPrompt: '#990000',
291 Token.OutPromptNum: '#ff0000 bold',
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 elif legacy =='nocolor':
303 elif legacy =='nocolor':
294 style_cls=_NoStyle
304 style_cls=_NoStyle
295 style_overrides = {}
305 style_overrides = {}
General Comments 0
You need to be logged in to leave comments. Login now