[IPython-User] Disabling color in IPython

MinRK benjaminrk@gmail....
Sun Oct 9 01:24:22 CDT 2011


On Sat, Oct 8, 2011 at 22:34, Aaron Meurer <asmeurer@gmail.com> wrote:

> This is on Mac OS X.
>
> Here is my IPython profile, if that helps:
>
> https://github.com/asmeurer/dotfiles/blob/master/.ipython/profile_default/ipython_config.py
> .
>  I'm guessing that having my colors set to 'linux' in my profile has
> something to do with it.
>

Yes - this is a silly thing that we need to figure out. The 'colors' cl_arg
sets InteractiveShell.colors.  You have set TerminalInteractiveShell.colors,
which is a subclass, and thus takes precedence.  So when you have colors set
in your config, and *also* at the command-line, you will be starting up
IPython with config:

c.InteractiveShell.colors = 'NoColor'
c.TerminalInteractiveShell.colors = 'Linux'

Now, if you change your config file to specify InteractiveShell.colors
instead of TerminalInteractiveShell.colors, the cl-arg will properly
override.

What we should really do is adjust the cl-arg system, such that it maps
somehow to all subclasses, or possibly just the lowest active subclass, so
it always gets highest priority.

-MinRK



> Aaron Meurer
>
> On Sat, Oct 8, 2011 at 11:12 PM, Fernando Perez <fperez.net@gmail.com>
> wrote:
> > Hi Aaron,
> >
> > On Sat, Oct 8, 2011 at 9:48 PM, Aaron Meurer <asmeurer@gmail.com> wrote:
> >>
> >> I'm trying to figure out how to disable colors from the command line.
> >> The IPython help (ipython --help) says:
> >>
> >> --colors=<CaselessStrEnum> (InteractiveShell.colors)
> >>    Default: 'LightBG'
> >>    Choices: ('NoColor', 'LightBG', 'Linux')
> >>    Set the color scheme (NoColor, Linux, or LightBG).
> >>
> >> I've tried ipython --colors=NoColor, ipython --colors="NoColor",
> >> ipython --colors='NoColors', ipython --colors NoColor, and none of
> >> them work (if I type just 1<Enter>, say, Out[1] is red).  I do have
> >> the colors set in my config file (c.TerminalInteractiveShell.colors =
> >> 'Linux').  I tried in the 0.11 release and the git master.
> >>
> >> Am I doing this wrong, or is this a bug?
> >
> > That's very odd, it works perfectly fine for me here...
> > "--colors=NoColor" turns off all coloring for me for In, Out,
> > tracebacks, etc, as expected.
> >
> > This is on a linux system, I assume?
> >
> > Cheers,
> >
> > f
> >
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20111008/719d6baa/attachment.html 


More information about the IPython-User mailing list