Home > OS >  How to adapt the command line in a miniconda3 environment in Ubuntu?
How to adapt the command line in a miniconda3 environment in Ubuntu?

Time:10-07

When activating any miniconda3 environment in Ubuntu (WSL2), also the command line is changed. Before activation, my command line looks like I have defined the PS1 variable in my .bashrc file:

username@workingdirectory$

After activation, the command line has changed to:

(base)username@pc:/path/working/directory$

including a change in colors.

I would like to have the command line look similar to my original command line (including the colors), perhaps with only the name of the current conda enviroment added at the end of the command line. E.g.: username@workingdirectory (base)$

I have already set the changeps1 to false in .condarc, but this only removes the conda environment from the command line and still changes the rest of the command line (including colors).

Does anyone know how I can adapt the command line in conda environments to my wishes?

CodePudding user response:

Conda does not offer advanced customizations beyond disabling the prompt modification (as you've done) or altering what the prefix looks like (e.g., env_prompt: "[{default_env}] "). See conda's configuration for details.

For advanced customizations to your prompt, use tools like:

  • Related