make colour code escape sequence in SetupProject compatible with zsh
Following this post, colour code escape sequences for zsh need to be escaped with
$'NEWPROMPT'
(leading dollar, and single quote - double quote fails). A small complication enters because within these strings, environment variables don't get resolved anymore, i.e. $PS1 needs to be outside the $' '
string.
Following Ben's explanation (and adding a bit try&error), I tested it in zsh
and bash
with:
export SP_PROMPT="yes"
cd LbScripts/InstallArea
source scripts/LbLogin.sh
export PYTHONPATH="/afs/cern.ch/work/p/pseyfert/LbScripts/InstallArea/python:/afs/cern.ch/lhcb/software/releases/LBSCRIPTS/LBSCRIPTS_v8r6p2/InstallArea/python"
export PATH=/afs/cern.ch/work/p/pseyfert/LbScripts/InstallArea/scripts:/afs/cern.ch/lhcb/software/releases/LBSCRIPTS/LBSCRIPTS_v8r6p2/InstallArea/scripts:/afs/cern.ch/sw/lcg/releases/LCG_84/Python/2.7.10/x86_64-slc6-gcc49-opt/bin:/afs/cern.ch/lhcb/software/releases/COMPAT/COMPAT_v1r19/CompatSys/x86_64-slc6-gcc49-opt/bin:/afs/cern.ch/sw/contrib/CMT/v1r20p20090520/Linux-x86_64:/afs/cern.ch/lhcb/bin:/afs/cern.ch/sw/lcg/contrib/CMake/3.3.2/Linux-x86_64/bin:/usr/local/bin:/bin:/usr/bin
. SetupProject.sh DaVinci v40r2
It looks fine in this quick inspection
Without the addition the prompt looks like that in zsh
Comments / suggestions?