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

embedded colored strings unset outer colored string #9

Open
andy-esch opened this issue Aug 30, 2017 · 3 comments
Open

embedded colored strings unset outer colored string #9

andy-esch opened this issue Aug 30, 2017 · 3 comments
Labels

Comments

@andy-esch
Copy link

Situations like this (or here in pipenv):

print(crayons.blue('horses, like {0}, eat grass too'.format(crayons.red('goats'))))

produce the following in Python 3.6.2:
screen shot 2017-08-30 at 15 43 41

To me, the expectation is that embedded colored text would not effect the coloring outside of there, so you'd get the following instead:
screen shot 2017-08-30 at 15 46 03

I spotted this after spawning a virtualenv shell from pipenv :) Notice closing parenthesis:
screen shot 2017-08-30 at 15 38 13

kathawala pushed a commit to kathawala/crayons that referenced this issue Oct 18, 2017
This was referenced Oct 18, 2017
@scientifichackers
Copy link

scientifichackers commented Mar 20, 2018

Can this fix also be issued for fstrings?
So it's possible to do something like this
crayons.green(f'should be green {crayons.blue("should be blue")} should be green ')

image

@ulgens
Copy link

ulgens commented Apr 17, 2018

@kennethreitz Don't you like this repo anymore? 😞

@KOLANICH
Copy link

Just use RichConsole.py

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

4 participants