Ask Your Question
1

How to change the unreadable dark blue colour in the SageMath command line window under Windows-10?

asked 2019-07-12 05:59:10 -0500

Sevas gravatar image

updated 2019-07-12 07:08:53 -0500

Iguananaut gravatar image

I have just installed SageMath 8.7 on my Windows-10 laptop and want to learn it. The font colour of the prompt and of the typed numbers is dark blue on the black background, totally unreadable. Google search delivers tons of such complaints about bash/pythin/mintty/cygwin command lines. All suggest to edit some configuration files, which are hardly possible to locate in SageMath, neither in the SageMath installation directory, nor in my user home directory. There is a file ".sage\profile_default\ipython_config.py" in my Windows home, containing the line c.TerminalInteractiveShell.colors = 'Linux' Changing this line has no effect.

edit retag flag offensive close merge delete

Comments

There appears to be a bug, because the default color scheme that's supposed to be installed (albeit still a dark scheme) is supposed to be much more readable. Apparently it's not getting installed though.

Iguananaut gravatar imageIguananaut ( 2019-07-12 07:09:32 -0500 )edit

If it is bug, then it is also a bug already in mintty. I tried mintty last year with cygwin (without SageMath) and gave up because of this issue. Some software products follow a principle "never use our default setting".

Sevas gravatar imageSevas ( 2019-07-12 07:40:32 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
2

answered 2019-07-12 07:57:51 -0500

Iguananaut gravatar image

The Windows installer is supposed to come with the "Linux" color scheme pre-selected, which is more readable on a dark background.

It looks like there is a bug in the installer. The file you found .sage\profile_default\ipython_config.py is the right file, but it's in the wrong location. It should be under .sage\ipython-5.0.0\profile_default\ipython_config.py.

Incidentally Sage 8.8 for Windowswas just released yesterday, and I confirmed that it has the same bug. I am working on creating a new release now, but in the meantime you can move the file I mentioned to the correct location and play around with your color scheme there. Some of the available default color schemes for the IPython terminal interface are given at: https://ipython.readthedocs.io/en/sta...

It's worth noting also that dealing with colors in the console can be tricky. Most colors schemes won't change your background, for example, and are designed for either a dark background or a light background in mind. It's also tricky because the way colors work is that the application outputs specific color codes to the terminal, and it's up to the terminal program to decide how to interpret those colors.

Sage for Windows (which is based on Cygwin), includes the MinTTY terminal, a terminal emulator for Cygwin. You can change the color settings by right-clicking on the window's title bar, and selection Options. From there you can change things such as your background color.

edit flag offensive delete link more
0

answered 2019-07-12 06:03:52 -0500

slelievre gravatar image

This is because the default color scheme in Sage is adapted to a light background, while Sage-Windows starts on dark background.

There is an "ipython magic" that allows to choose the color scheme for syntax highlighting.

At the Sage prompt, type:

sage: %colors Linux

To make that permanent, add that line to your init.sage file, which is read each time Sage starts.

edit flag offensive delete link more

Comments

Thank you, this works. Which other color schemes are available in addition to "Linux"? A remaining cosmetic inconvenience is the parrot-like look of the command-line window. I typed a wrong command x:=2 and got a message error. This short dialog occupied just 5 lines, but had 8 different colors! Though I am not a friend of 50 shades of black, but this default multi-coloring is an opposite extremity. Is any reasonable compromise available?

Sevas gravatar imageSevas ( 2019-07-12 07:51:02 -0500 )edit

colors is IPython magic and their documentation says

Currently implemented schemes: NoColor, Linux, LightBG.
vdelecroix gravatar imagevdelecroix ( 2019-07-14 03:51:41 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2019-07-12 05:59:10 -0500

Seen: 106 times

Last updated: Jul 12