Archive for September, 2008

“Tagging” the ipython prompt

September 18, 2008

People that run many ipython sessions at the same time will want to “mark” an ipython session, so that they will immediately know what window they are in by just looking at the prompt. If you have 15 ipython sessions with exactly the same prompt, it becomes very hard to tell them apart.

Sh profile just got a feature that allows you to tag the prompt by just assigning to _prompt_title variable. For example, I have the following invocation in the end of my .bashrc in scratchbox:

ipython -p sh -i -c “_prompt_title=’sbox'”

Now, Scratchbox prompt will look like this:
sbox[~]|4> pwd

This allows me tell apart the terminals that are running in scratchbox from the ones running on linux host. Obviously you can assign to _prompt_title during a live ipython session, if you decide to “dedicate” that particular session to a particular task.