How can I edit the conda prompt's behavior without touching my normal prompt? I want to retain conda's prepend-to-PS1 behavior, but change the string that gets prepended.
The question how to modify conda 'source activate' ps1 behavior is very similar. However, the solution there is to either inject the conda prefix into the middle of PS1
and/or edit PROMPT_COMMAND
. This breaks the encapsulation I want, and is very hacky when the prepend-to-PS1 behavior is still desirable.
My normal prompt string looks like this:
previous output
previous output
user@short-domain fullpath
$
This is the behavior I want when no conda environment is active. With a conda environment active, this becomes:
previous output
previous output
(<env-name-here>)
user@short-domain fullpath
$
I don't like how this eliminates the blank line between the previous command's output and the new prompt. Unlike the question I mentioned above, I specifically want (<env-name-here>)
on its own line:
previous output
previous output
(<env-name-here>)
user@short-domain fullpath
$
Note how this means the conda prompt modification needs to include its own newline character. I could hack the other question's answers into working, but again, I don't want to touch any variables related to my normal prompt.