Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: 'TARGET' is not a color! #3578

Closed
swedneck opened this issue May 16, 2020 · 1 comment
Closed

ValueError: 'TARGET' is not a color! #3578

swedneck opened this issue May 16, 2020 · 1 comment
Labels

Comments

@swedneck
Copy link
Contributor

xonfig

+------------------+---------------------+
| xonsh            | 0.9.18              |
| Git SHA          | 26475146            |
| Commit Date      | May 5 06:42:28 2020 |
| Python           | 3.7.7               |
| PLY              | 3.11                |
| have readline    | True                |
| prompt toolkit   | 3.0.5               |
| shell type       | prompt_toolkit      |
| pygments         | 2.6.1               |
| on posix         | True                |
| on linux         | True                |
| distro           | fedora              |
| 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

Xonsh should support the target color in $LS_COLORS

Current Behavior

Traceback (if applicable)

Traceback (most recent call last):
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/__amalgam__.py, line 24210, in main
    return main_xonsh(args)
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/__amalgam__.py, line 24239, in main_xonsh
    shell.shell.cmdloop()
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/ptk_shell/shell.py, line 197, in cmdloop
    line = self.singleline(auto_suggest=auto_suggest)
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/ptk_shell/shell.py, line 101, in singleline
    self.styler.style_name = env.get(XONSH_COLOR_STYLE)
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/__amalgam__.py, line 17732, in styler
    self._styler = XonshStyle(env.get(XONSH_COLOR_STYLE))
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/pyghooks.py, line 345, in __init__
    self.style_name = style_name
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/pyghooks.py, line 384, in style_name
    color_token = color_token_by_name(xonsh_color, self.styles)
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/pyghooks.py, line 223, in color_token_by_name
    pc = color_name_to_pygments_code(xc[0], styles)
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/pyghooks.py, line 143, in color_name_to_pygments_code
    if token in styles:
  File /usr/lib64/python3.7/collections/__init__.py, line 931, in __contains__
    return any(key in m for m in self.maps)
  File /usr/lib64/python3.7/collections/__init__.py, line 931, in <genexpr>
    return any(key in m for m in self.maps)
  File /usr/lib64/python3.7/_collections_abc.py, line 666, in __contains__
    self[key]
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/pyghooks.py, line 312, in __getitem__
    value = code_by_name(name, self.styles)
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/pyghooks.py, line 205, in code_by_name
    code = color_name_to_pygments_code(fg, styles)
  File /home/tim/.xonsh/lib64/python3.7/site-packages/xonsh/pyghooks.py, line 147, in color_name_to_pygments_code
    raise ValueError(!r is not a color!.format(name))
ValueError: 'TARGET' is not a color!
Xonsh encountered an issue during launch
Failback to /bin/sh

Steps to Reproduce

  • run LS_COLORS='ln=target' xonsh in bash
@laloch
Copy link
Member

laloch commented May 16, 2020

Thanks for reporting, @swedneck!
I can confirm the issue. It was supposed to be fixed by #3255, but apparently was not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants