Convert ansi-colors names back in all shells but ptk2

This commit is contained in:
Morten Enemark Lund 2018-08-16 19:43:08 +02:00
parent 046bc47779
commit 2d1162ebe8
2 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,15 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* Fixed a regression taat prevented the readline backend from beeing used. This
regression was caused by the new ansi-color names, which are incompatible with
pygments 2.2.
**Security:** None

View file

@ -445,7 +445,7 @@ class XonshStyle(Style):
self._style_name = value
# Convert new ansicolor names to old PTK1 names
# Can be remvoed when PTK1 support is dropped.
if builtins.__xonsh_shell__.shell_type in ('prompt_toolkit1', 'jupyter'):
if builtins.__xonsh_shell__.shell_type != 'prompt_toolkit2':
for smap in [self.trap, cmap, PTK_STYLE, self._smap]:
smap.update(ansicolors_to_ptk1_names(smap))
if ON_WINDOWS and 'prompt_toolkit' in builtins.__xonsh_shell__.shell_type: