Tip/Foam version in shell prompt

From OpenFOAMWiki
Jump to: navigation, search

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)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Print/export