Tip/Foam version in shell prompt

From OpenFOAMWiki
Revision as of 15:57, 3 January 2012 by Bgschaid (Talk | contribs)

If you're working with multiple OF-versions of OpenFOAM it can be useful if the used version of OpenFOAM is printed on the shell prompt (just like the current directory or other information you might have there).

Add

 
export PS1="(OF:\$WM_PROJECT_VERSION) $PS1"

to the end of your .bashrc and you'll have an output like (OF:1.9.x) on the left of your prompt (if the current shell uses OpenFOAM-1.9.x)

If you're a zsh-user then

 
export PS1="%U(OF:\$WM_PROJECT_VERSION)%u $PS1"

in .zshrc.local will give you the same information (underlined)