Repository: xonsh/xonsh

Issue:
Colors not displaying properly on readline
@melund - would you mind taking a look at this please?

## xonfig

```
+------------------+----------------------+
| xonsh            | 0.7.4                |
| Git SHA          | 55d69ee6             |
| Commit Date      | Aug 11 10:22:24 2018 |
| Python           | 3.6.6                |
| PLY              | 3.11                 |
| have readline    | True                 |
| prompt toolkit   | 2.0.4                |
| shell type       | readline             |
| pygments         | 2.2.0                |
| on posix         | True                 |
| on linux         | True                 |
| distro           | debian               |
| on darwin        | False                |
| on windows       | False                |
| on cygwin        | False                |
| on msys2         | False                |
| is superuser     | False                |
| default encoding | utf-8                |
| xonsh encoding   | utf-8                |
| encoding errors  | surrogateescape      |
+------------------+----------------------+
```

## Expected Behavior
Should be able to type 1

## Steps to Reproduce

Even just trying to evaluate 1:

```console
scopatz@artemis ~ $ 1
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
  File "/home/scopatz/.local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 15175, in default
    run_compiled_code(code, self.ctx, None, 'single')
  File "/home/scopatz/.local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 2358, in run_compiled_code
    func(code, glb, loc)
  File "<xonsh-code>", line 1, in <module>
  File "/home/scopatz/.local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 20874, in _pprint_displayhook
    print_color(tokens)
  File "/home/scopatz/.local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 5103, in print_color
    builtins.__xonsh_shell__.shell.print_color(string, **kwargs)
  File "/home/scopatz/.local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 17894, in print_color
    formatter = pyghooks.XonshTerminal256Formatter(style=style_proxy)
  File "/home/scopatz/.local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 345, in __call__
    return obj(*args, **kwargs)
  File "/home/scopatz/.local/lib/python3.6/site-packages/xonsh/pyghooks.py", line 1350, in __init__
    super().__init__(*args, **kwargs)
  File "/home/scopatz/miniconda3/lib/python3.6/site-packages/pygments/formatters/terminal256.py", line 134, in __init__
    self._setup_styles()  # convert selected style's colors to term. colors
  File "/home/scopatz/miniconda3/lib/python3.6/site-packages/pygments/formatters/terminal256.py", line 224, in _setup_styles
    self.style_string[str(ttype)] = (escape.color_string(),
  File "/home/scopatz/miniconda3/lib/python3.6/site-packages/pygments/formatters/terminal256.py", line 62, in color_string
    esc = codes[self.bg[5:]]
KeyError: 'rightblack'
```



Discussion:
yikes... I will fix it in a few hours.
Thanks so much!

Resolving patch:
diff --git a/xonsh/pyghooks.py b/xonsh/pyghooks.py
--- a/xonsh/pyghooks.py
+++ b/xonsh/pyghooks.py
@@ -445,7 +445,7 @@ def style_name(self, value):
         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:


Test patch: