pyenv-virtualenv
pyenv-virtualenv copied to clipboard
Possibly setting PROMPT_COMMAND with a dangling semicolon
In this line: https://github.com/pyenv/pyenv-virtualenv/blob/75e84742db6e58a52765c4f7b98bd5331a5e0671/bin/pyenv-virtualenv-init#L143
One should also check whether PROMPT_COMMAND is empty or not. If it is empty, just set it PROMPT_COMMAND="_pyenv_virtualenv_hook avoiding to add a dangling semicolon.
In my case this breaks when another script is doing this:
if [[ ! -z "${PROMPT_COMMAND// }" ]]; then
PROMPT_COMMAND="${PROMPT_COMMAND};preexec_invoke_cmd"
resulting in
bash: PROMPT_COMMAND: line 10: syntax error near unexpected token `;;'
bash: PROMPT_COMMAND: line 10: `__powerline_prompt_command;_pyenv_virtualenv_hook;;preexec_invoke_cmd'