Repository: xonsh/xonsh

Issue:
NO_COLOR and RESET are not the same
<!--- Provide a general summary of the issue in the Title above -->
<!--- If you have a question along the lines of "How do I do this Bash command in xonsh"
please first look over the Bash to Xonsh translation guide: https://xon.sh/bash_to_xsh.html
If you don't find an answer there, please do open an issue! -->

## xonfig

<details>

```
+------------------+---------------------+
| xonsh            | 0.9.22.dev166       |
| Git SHA          | 42e1c85e            |
| Commit Date      | Oct 2 17:41:59 2020 |
| Python           | 3.8.5               |
| PLY              | 3.11                |
| have readline    | True                |
| prompt toolkit   | 3.0.3               |
| shell type       | prompt_toolkit      |
| pygments         | 2.7.1               |
| on posix         | True                |
| on linux         | True                |
| distro           | manjaro             |
| 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     |
| on jupyter       | False               |
| jupyter kernel   | None                |
+------------------+---------------------+

```

</details>

## Expected Behavior
<!--- Tell us what should happen -->
using `RESET` should reset color as well as background . But only color is reset. While NO_COLOR resets both.

## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->
<!--- If part of your bug report is a traceback, please first enter debug mode before triggering the error
To enter debug mode, set the environment variable `XONSH_DEBUG=1` _before_ starting `xonsh`.
On Linux and OSX, an easy way to to do this is to run `env XONSH_DEBUG=1 xonsh` -->

## Steps to Reproduce
<!--- Please try to write out a minimal reproducible snippet to trigger the bug, it will help us fix it! -->
using from master branch

## For community
⬇️  **Please click the 👍 reaction instead of leaving a `+1` or 👍  comment**



Discussion:
Hmm they should be exactly the same... That seems odd. CC @cafehaine
yup, only `DEFAULT` resets the color without the attributes, at least during my testing with readline.

I might have missed something while testing with PTK as the behavior is already different

EDIT: my bad, I didn't read the part about the background, I didn't test that at all
![image](https://user-images.githubusercontent.com/11913365/95167933-c7a43c80-07b0-11eb-9927-48f027238cf4.png)
I'm observing the opposite of what you're describing, but this still is a differing behavior that should be fixed.

Resolving patch:
diff --git a/xonsh/ansi_colors.py b/xonsh/ansi_colors.py
--- a/xonsh/ansi_colors.py
+++ b/xonsh/ansi_colors.py
@@ -312,7 +312,7 @@ def ansi_color_escape_code_to_name(escape_code, style, reversed_style=None):
     norm_names = []
     prefixes = ""
     for name in names:
-        if name == "RESET":
+        if name in ("RESET", "NO_COLOR"):
             # skip most '0' entries
             continue
         elif "BACKGROUND_" in name and n:
diff --git a/xonsh/pyghooks.py b/xonsh/pyghooks.py
--- a/xonsh/pyghooks.py
+++ b/xonsh/pyghooks.py
@@ -94,7 +94,7 @@ def color_by_name(name, fg=None, bg=None):
         New computed background color name.
     """
     name = name.upper()
-    if name == "RESET":
+    if name in ("RESET", "NO_COLOR"):
         return Color.DEFAULT, None, None
     m = RE_BACKGROUND.search(name)
     if m is None:  # must be foreground color
diff --git a/xonsh/style_tools.py b/xonsh/style_tools.py
--- a/xonsh/style_tools.py
+++ b/xonsh/style_tools.py
@@ -142,7 +142,7 @@ def color_by_name(name, fg=None, bg=None):
         New computed background color name.
     """
     name = name.upper()
-    if name == "RESET":
+    if name in ("RESET", "NO_COLOR"):
         return Color.RESET, None, None
     m = RE_BACKGROUND.search(name)
     if m is None:  # must be foreground color


Test patch: