Reset $XONSH_COLOR_STYLE on bad value

Without doing this, an error message is printed on every iteration
of the command loop.

Perhaps it might be better to reset to the previous value if it exists,
else 'default'?
This commit is contained in:
Justin Moen 2016-07-15 21:23:16 -07:00
parent 2a2669c955
commit 370bf5668c

View file

@ -321,6 +321,7 @@ class XonshStyle(Style):
warn('Could not find style {0!r}, using default'.format(value),
RuntimeWarning)
value = 'default'
builtins.__xonsh_env__['XONSH_COLOR_STYLE'] = value
cmap = STYLES[value]
try:
self._smap = get_style_by_name(value)().styles.copy()