Ask Your Question

sage terminal colors

asked 2013-04-24 07:17:36 -0500

kjlvcxzoiperwq gravatar image

updated 2015-01-14 04:46:53 -0500

FrédéricC gravatar image

I just upgraded from sage version 4.8 to version 5.8. I was pleasantly surprised to see colouring of the text similar to ipython does. However, sage seems to be defaulting to colours geared towards white background and black text. I have a black background and white text. The default colour scheme is very hard to read and I can't figure out how to change it. I did find this web page ( but following the instructions in it does not work and my sage colour scheme is always that of figure 3 on the link, but my system terminal settings have a black background and white text. Although I would prefer the right colour scheme, the old pure black and white would be better than what I have now. How can I change the sage terminal colours to something more readable? I don't want to change my default system terminal settings.

I can type "%colors Linux" once I launch sage and it does then give me the colour scheme that I want, but I can't get the scheme to persist from session to session.

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted

answered 2013-04-24 07:46:31 -0500

fidbc gravatar image

You can try adding the line

%colors Linux

to the file $HOME/.sage/init.sage, that will make sage execute that command automatically at startup (taken from the sage FAQ).

edit flag offensive delete link more


That worked. The file init.sage didn't exist so I had to create it myself.

kjlvcxzoiperwq gravatar imagekjlvcxzoiperwq ( 2013-04-24 07:52:43 -0500 )edit

answered 2016-12-16 11:15:42 -0500

Sébastien gravatar image

Open the file profile_default/ inside the folder given by the command sage -ipython locate (if you do not have this file, sage -ipython profile create creates it). In that file, uncommenting the following line will set the default color properly:

# Set the color scheme (NoColor, Neutral, Linux, or LightBG).
c.InteractiveShell.colors = 'Linux'     # Linux is for dark background
edit flag offensive delete link more

answered 2016-12-13 02:09:40 -0500

Daniel Krenn gravatar image

FYI, %colors offers NoColor, Linux and LightBG.

edit flag offensive delete link more


Is it possible to customize the schemes?

nsirolli gravatar imagensirolli ( 2017-01-12 12:51:02 -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

1 follower


Asked: 2013-04-24 07:17:36 -0500

Seen: 1,965 times

Last updated: Dec 16 '16