How to start a `jupyter console --existing` shell with no prompt colors?

858 views
Skip to first unread message

Dan Davison

unread,
Oct 1, 2016, 9:42:13 PM10/1/16
to Project Jupyter
How can I tell a  `jupyter console --existing` shell to not use any colors? In particular, no color for the prompts.

I can achieve this in a plain ipython shell with the following in ipython_config.py

c.TerminalInteractiveShell.colors = 'NoColor'

However, I have not managed to do this in `jupyter console` (whether `--existing` or not, but it is the `--existing` case that I particularly want a solution for).

Thanks!

Dan

Thomas Kluyver

unread,
Oct 2, 2016, 4:25:29 AM10/2/16
to Project Jupyter
You can turn off the colours that come from the kernel (tracebacks, inspection output) by setting c.InteractiveShell.colors in the kernel config:
http://ipython.readthedocs.io/en/stable/config/options/kernel.html

There is not currently a config option in jupyter_console to turn off prompt colours and syntax highlighting in the frontend, but it would be a reasonable addition to make this customisable.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/ec248859-013a-40eb-a539-9247197a5000%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Davison

unread,
Oct 3, 2016, 2:19:58 PM10/3/16
to Project Jupyter
Hi Thomas,

I think I misdiagnosed my problem. I believe what I am asking for is for --simple-prompt to be added to jupyter console. So that's https://github.com/jupyter/jupyter_console/issues/93

Full explanation: I run some of my python shell processes inside emacs. This works fine for ipython 4.1.1 but in 5.1.0 it results in junk escape sequences at the prompt. (I mistakenly thought these were ANSI color escape codes). The solution is to pass --simple-prompt. However, --simple-prompt is not available in jupyter console yet.

I really appreciate the `console` feature because it allows me to use .py files to load code into a kernel being shared with a notebook, thus keeping the notebook focused on graphical output, rather than implementation. So #93 would be great for people who take this approach and can't use the fancy prompt/completion features.

Thanks for all the work,

Dan



On Sun, 2 Oct 2016 at 01:25 Thomas Kluyver <tak...@gmail.com> wrote:
You can turn off the colours that come from the kernel (tracebacks, inspection output) by setting c.InteractiveShell.colors in the kernel config:
http://ipython.readthedocs.io/en/stable/config/options/kernel.html

There is not currently a config option in jupyter_console to turn off prompt colours and syntax highlighting in the frontend, but it would be a reasonable addition to make this customisable.

On 2 October 2016 at 02:42, Dan Davison <danda...@gmail.com> wrote:
How can I tell a  `jupyter console --existing` shell to not use any colors? In particular, no color for the prompts.

I can achieve this in a plain ipython shell with the following in ipython_config.py

c.TerminalInteractiveShell.colors = 'NoColor'

However, I have not managed to do this in `jupyter console` (whether `--existing` or not, but it is the `--existing` case that I particularly want a solution for).

Thanks!

Dan

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/ec248859-013a-40eb-a539-9247197a5000%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/OynBsuwzeQw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+u...@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages