How do we customize the color scheme for ipdb?
See original GitHub issueBy 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:
- ipython profile create
- pygmentize -L style
- vim profile_default/ipython_config
c.TerminalInteractiveShell.highlighting_style = 'tomorrownight'
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:
- Why doesn’t ipdb pick up the ipython pygment style? Else how can I override the ipdb shell colors?
- How can I modify the ipdb prompt color?
Thanks for your help in advance!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Developers - How do we customize the color scheme for ipdb? -
By searching around, I understand (probably incorrectly) that ipdb should use ipython's color scheme by default. And that ipython use pygments styles.
Read more >How can I turn off color in ipdb? - Stack Overflow
Old answer - insert this into code (2019, doesn't work): import ipdb; ipdb.def_colors='NoColor'; ipdb.set_trace().
Read more >Better Python Debugging With IPDB - Hasil Sharma
Searching for a better approach to debug code, there is always something better available out there, I came across pdb and ipdb.
Read more >Colors and fonts | PyCharm Documentation - JetBrains
You can use a predefined color scheme or customize it to your liking. It is also possible to share schemes. Select a color...
Read more >Williams 'Blackout' - Internet Pinball Machine Database
The first game designed and produced with Lane Change was Williams' 1980 'Firepower'. ... His usage of color influenced me for the rest...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have never tried to customize
IPython
oripdb
colors myself.I am sorry I cannot help and hope you’ll report here if you succeeds.
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
c.InteractiveShell.colors
in the config file. For the second one there are very limited options and they only use basic 8-bit colors, presumably for compatibility. Using different ANSI escape codes, you can get a lot of much nicer colors depending on what your terminal supports.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.