Tuesday, September 10, 2013

sagemath terminal colours - green > blue

Sagemath includes an embedded version of ipython and any changes you make to terminal colours need to happen in ipython_config.py in the correct place.

After doing a sage install there is a directory on my computer at location:
~/.sage/ipython-0.12/

The goal of this short set of hints is to assist you in creating a suitable profile_sage/ipython_config.py file.

That file should look like this:

# Configuration file for ipython.

c = get_config()

# Set the color scheme (NoColor, Linux, or LightBG).                                                                    
c.TerminalInteractiveShell.colors = 'Linux'

What that will achieve is to make your prompt green instead of blue.
The default (blue) seems a little bright on the eyes, so by setting colors = 'Linux' you get the less garish green prompt instead.

You can just run ahead and use geany or another editor to create ipython_config.py with content detailed above.

If you prefer to look at what iPython itself generates then you might wish to know of these two commands:
  • ipython profile list
  • ipython profile create justcreatedbyme
However be aware that you want to be running the embedded ipython version when doing 'profile create' in order to be sure a a fully compatible profile is created.
( Manual copy / rename things to get file to proper location of
profile_sage/ipython_config.py )

An example of the output from profile list is shown below:

List of profiles available to iPython