show virtualenv breaks new line in terminal. Code fix include
mateuspadua opened this issue · comments
Mateus Pádua commented
I enabled the function omg_prompt_callback to show current virtualenv in ubuntu and this dont leave terminal create new line, how in the image below.
I copied this script to my .bashrc
VIRTUAL_ENV_DISABLE_PROMPT=true
function omg_prompt_callback() {
if [ -n "${VIRTUAL_ENV}" ]; then
echo "\e[0;31m(`basename ${VIRTUAL_ENV}`)\e[0m "
fi
}
To fix this i changed the code above for code below:
VIRTUAL_ENV_DISABLE_PROMPT=true
function omg_prompt_callback() {
RED='\[\033[31m\]'
if [ -n "${VIRTUAL_ENV}" ]; then
echo "${RED}(${VIRTUAL_ENV##*/}) "
fi
}
Thanks and i hope it helps
Brian Zhang commented
how did you do the color conversion from \e[0;31m
to \[\033[31m\]
?
Mateus Pádua commented
Hello, atav32, but i picked this color in web. sorry for not being able to help
mucio commented
This really solved the problem on Ubuntu 16.04