Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

ValueError: Invalid foreground color: red #1

Closed
icyphox opened this issue Jun 25, 2018 · 2 comments
Closed

ValueError: Invalid foreground color: red #1

icyphox opened this issue Jun 25, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@icyphox
Copy link

icyphox commented Jun 25, 2018

Hey, really cool project you've got there. Unfortunately for me, it crashes every time I try running it with the following traceback:

 Traceback (most recent call last):
  File "/home/icy/.local/bin/termtosvg", line 11, in <module>
    sys.exit(main())
  File "/home/icy/.local/lib/python3.6/site-packages/termtosvg/__main__.py", line 186, in main
    anim.render_animation(replayed_records, svg_filename)
  File "/home/icy/.local/lib/python3.6/site-packages/termtosvg/anim.py", line 208, in render_animation
    for event_record in record_group:
  File "/home/icy/.local/lib/python3.6/site-packages/termtosvg/term.py", line 268, in replay
    redraw_buffer[row][column] = from_pyte_char(screen.buffer[row][column], palette)
  File "/home/icy/.local/lib/python3.6/site-packages/termtosvg/anim.py", line 58, in from_pyte
    raise ValueError('Invalid foreground color: {}'.format(char.fg))
ValueError: Invalid foreground color: red

It happens just when I start typing something into the prompt, after running termtosvg.

@nbedos
Copy link
Owner

nbedos commented Jun 25, 2018

Hey! Sorry about that and thank you for opening an issue.

I was able to reproduce a similar crash when there are bright colors displayed on the terminal, but only the first 8 colors are defined in ~/.Xresources

I've released a new version to pypi which fixes this problem. Can you try it and let me know if it fixes the crash you're experiencing ?

pip install termtosvg==0.2.1

Thanks :)

@nbedos nbedos added the bug Something isn't working label Jun 25, 2018
@icyphox
Copy link
Author

icyphox commented Jun 26, 2018

Yep, I can confirm that it's fixed now :)
Nice work.
Closing this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants