question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Colored prompt for embed()

See original GitHub issue

import IPython; IPython.embed() has no colors for me. https://github.com/ipython/ipython/issues/9450 is related but old.

IPython 7.1.1 Python 3.6.6 Ubuntu 18.04

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:14
  • Comments:10

github_iconTop GitHub Comments

55reactions
banoolcommented, Aug 14, 2019

For anyone who stumbles across this, I was able to fix it just like this:

IPython.embed(colors="neutral")
17reactions
topherocitycommented, Dec 10, 2018

Also here.

IPython 7.2.0 Python 3.6.6 RHEL 7.4 / Mac OS 10.14

It seems that this issue originates from #11265.

https://github.com/ipython/ipython/blob/0acd580fce7192044a6f846dd09d31d498018347/IPython/terminal/embed.py#L369-L371

Why is the default now to implicitly assign colors to ‘NoColor’?

For a dirty fix, I set

IPython.embed(using=False)

which is obviously abusing code, and uses the IPython.core.async_helpers._AsyncIORunner instead of IPython.core.async_helpers._pseudo_sync_runner. For my particular case I’m not sure what unintended side effects that may have.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bash/Prompt customization - ArchWiki
Bash has several prompts which can be customized to increase productivity, ... 2.3 ANSI escape sequences; 2.4 Embedding commands ...
Read more >
How to Customize (and Colorize) Your Bash Prompt
Feel free to experiment with different special characters and commands to assemble your ideal command prompt. How to Add Colors to Your Bash ......
Read more >
IPython.embed() does not use terminal colors - Stack Overflow
I will frequently use IPython.embed() to examine the state of running code. In earlier versions of IPython, it correctly determines color ...
Read more >
What color codes can I use in my Bash PS1 prompt?
(And do not embed variables inside printf statements, use %s .) – alexia. May 4, 2014 at 15:08. 2.
Read more >
How to colorize the Powershell prompt? - Super User
More advanced colours. If you aren't happy with the basic 16-colour palette, you can use full 24-bit colours with the form:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found