Open new Terminal tab in current working directory doesn't work
So I found the problem with the Terminal and I'm posting the answer hoping it can help others. The problem was in the definition of the PROMPT_COMMAND environmental variable. I changed its definition from 

export PROMPT_COMMAND='history -n;'


to

export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ;} history -n"


appending at the end of the existing PROMPT_COMMAND instead and this solved the problem.