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

styling prompt, {color.Normal} excepts #1963

Closed
kernc opened this issue Jun 14, 2012 · 8 comments
Closed

styling prompt, {color.Normal} excepts #1963

kernc opened this issue Jun 14, 2012 · 8 comments
Labels
Milestone

Comments

@kernc
Copy link

kernc commented Jun 14, 2012

version: ipython 0.12

With my prompt set to:
c.PromptManager.in_template = '{color.LightGreen} \T {color.Normal}\Y2 {color.LightGreen}\$'
I get an AttributeError: NoColors instance has no attribute 'Normal'

But I checked:

>>> from IPython.utils.coloransi import InputTermColors
>>> InputTermColors.Normal  # color has Normal, which is supposed to reset
'\x01\x1b[0m\x02'
@minrk
Copy link
Member

minrk commented Jun 14, 2012

try color.normal (lowercase)

@kernc
Copy link
Author

kernc commented Jun 14, 2012

yup, that works! thanks. :-)
is there any documentation on this, e.g. how to use colors with the new PromptManager? because I learned it from another bug report. :-D

@takluyver
Copy link
Member

There's a table of things you can include here, but it doesn't include colours:

http://wiki.ipython.org/Cookbook/Dynamic_Prompt

If you want to help us get this into the documentation, that would be great.

@minrk
Copy link
Member

minrk commented Jun 14, 2012

Unfortunately, at the moment the source is the docs.

@kernc
Copy link
Author

kernc commented Jun 14, 2012

but why exactly is it that color.Normal (uppercase like all the rest) doesn't work? can this be fixed (i.e. made consistent)?

@minrk
Copy link
Member

minrk commented Jun 14, 2012

Indeed, that's just a tiny omission in NoColors. Since it's so small, I will add it to #1962

@minrk
Copy link
Member

minrk commented Jun 14, 2012

Check out #1962 - your prompt works correctly for me with that branch.

@kernc
Copy link
Author

kernc commented Jun 14, 2012

thanks. and I've added ipython color prompt info to the wiki.

@minrk minrk closed this as completed in 6927660 Jun 15, 2012
ivanov pushed a commit to ivanov/ipython that referenced this issue Jun 15, 2012
Support unicode prompts

fixes potential issues when cwd/USER/HOME might have been unicode.

closes ipython#1961
closes ipython#1963
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Support unicode prompts

fixes potential issues when cwd/USER/HOME might have been unicode.

closes ipython#1961
closes ipython#1963
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

3 participants