-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Restore the ability to use %colors to switch terminal theme. #9655
Conversation
@fperez would you like to try/review this ? If this suits you I'll document it. |
@@ -324,6 +324,7 @@ def colors(self, parameter_s=''): | |||
%colors nocolor | |||
""" | |||
def color_switch_err(name): | |||
raise ValueError() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change to an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, debug thing.
BTW, I even think you it would be cool to leave the new default prompt colors unchanged for the "linux" case: the highlight of the prompt numbers is very nice. So we can modernize them a bit, all I want to get is the ability to control the three 'basic' schemes (nothing, dark, light) from the command line including prompts... In summary:
And otherwise apply the fixes for |
Confirming the problem about not honoring the command-line override is a traitlets bug, as suspected by @Carreau... Rolling traitlets back from master to 4.0 did the trick. So let's forget about that part as an ipython issue. |
The question is was this bug release in any of the stable versions of traitlets ? |
yes, it appeared between 4.0 and 4.1, it's present in 4.1.0. |
Opened as ipython/traitlets#248 |
Great, so the last question is: do you have the patience to make the last modifications I suggested (using the current default colors for linux and a blue/red version of the same --with brighter prompt numbers-- for lightbg)? We could merge as-is, but I think that will be both cleaner (as it only introduces one new set of prompt colors, not two) and nicer (as it does modernize things a bit and diminishes the mismatch between using |
Only problem is "monokai" is unreadable on lighbg: Pushed your required changes and docs. @willingc do you want to get a looks at the docs additions I made ? |
I think it's OK: the default one is a good compromise for light/dark, where as the explicit request for light/dark themes will optimize specifically for those. |
👍 |
And restore previous coloring of prompts on classical color themes. Unlike 4.x this will **not** change with your terminal background. If the hightligh_style of TerminalInteractiveSHell is set to `legacy` then it uses the value of TermianlInteractiveShell.colors to select the theme: monokai for darkbg/linux (by decision of BDFL), and old prompt values. default for lightbg Closes ipython#9648
Thanks @jbasalone and @fperez. Rebase for conflict and pushed. |
@@ -20,7 +20,7 @@ Backwards incompatible changes | |||
------------------------------ | |||
|
|||
|
|||
The `install_ext magic` function which was deprecated since 4.0 have now been deleted. | |||
The `install_ext magic` function which was deprecated since 4.0 have now been deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have -> has
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I give you access to my fork so if needed you can make changes directly.
@Carreau I'm making the rest of the edits and will push to your branch. Seems simpler :-) |
Thanks ! Seems great ! Appreciated ! |
Thanks @willingc ! |
Ok, self merging. I'll try to do an RC this afternoon. |
Thanks everyone, kudos to @willingc for your prompt (no pun intended :) doc work. Love seeing good code landing with proper docs. Next thing you know, our project-wide practices will actually have improved!! ;) |
Using Spock with a bright background terminal themes commands are not visible It seems related with an IPython V5 bug ipython/ipython#9655 Change spock colors to 'Neutral' for IPython >= V5 Fix sardana-org#706
And restore previous coloring of prompts on classical color themes.
Unlike 4.x this will not change with your terminal background.
If the hightligh_style of TerminalInteractiveSHell is set to
legacy
then it uses the value of TermianlInteractiveShell.colors to select the
theme:
monokai for darkbg/linux (by decision of BDFL), and old prompt values.
default for lightbg
Closes #9648