-
Notifications
You must be signed in to change notification settings - Fork 147
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
How do we customize the color scheme for ipdb? #185
Comments
I have never tried to customize I am sorry I cannot help and hope you'll report here if you succeeds. |
Investigating the Prompt color issueI can modify the prompt text in prompt = 'ipdb> ' I can modify the prompt color in class TerminalInteractiveShell(InteractiveShell):
def _make_style_from_name_or_cls(self, name_or_cls):
if name_or_cls == 'legacy':
else :
if isinstance(name_or_cls, str):
style_cls = get_style_by_name(name_or_cls)
else:
style_cls = name_or_cls
style_overrides = {
Token.Prompt: '#009900', # <-- OUR GREEN
Token.PromptNum: '#ansibrightgreen bold',
Token.OutPrompt: '#990000',
Token.OutPromptNum: '#ansibrightred bold',
}
style_overrides.update(self.highlighting_style_overrides)
style = merge_styles([
style_from_pygments_cls(style_cls),
style_from_pygments_dict(style_overrides),
]) Looks like we can update this from from pygments.token import Token
c.TerminalInteractiveShell.highlighting_style_overrides = {
Token.Prompt: '#cc6666',
} |
|
I went down this rabbit hole yesterday, and the solution does lie within IPython. IPython uses two different color schemes: one is Pygments, and the other one is changed through If you compare this to master, you can see all the files that need to be changed to add the theme. It's probably possible to do all of that through the config file, but I'm not sure how. |
Since this is the first hit on the googz for change ipdb colors - In my case the blues were too dark against the black background.
|
@camAtGitHub Thanks a lot for that walkthrough ! |
@gotcha Is there currently a way to tell ipdb to start a non-default ipython-profile? my usecase: as a quickfix, I'm currently wrapping my all code in startup-file in a condition like this:
an ipdb-config setting to start ipdb initialised with an "ipdb-"ipython-profile would nice I think:
|
I'll create a PR for this |
See #266 |
Related: #50, #144, #57, #1
By searching around, I understand (probably incorrectly) that ipdb should use ipython's color scheme by default. And that ipython use pygments styles.
So I tried the following:
Within the same virtualenv, I get colors within ipython, but not within ipdb:
The prompt seems to be another matter, and I haven't figured out how to change its color yet.
Therefore, I have 2 related questions:
Thanks for your help in advance!
The text was updated successfully, but these errors were encountered: