MacOS – My shell prompt changed … without prompting

bashcatalinacommand linemacosterminal

I'm still running bash on MacOS Catalina 10.15.5 (19F101). Sorry.

Recently, I don't know why, the prompt in my bash sessions is acting up. There appears at the start of every prompt the string (base):

(base) MyComputer:~ myname$

The result of cat /etc/bashrc is:

# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
   return
fi

PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize

[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"

I don't see anything related in /etc/bashrc_Apple_Terminal.

The result of echo $PS1 is:

(base) \h:\W \u\$

I have no local ~/.bashrc, and the result of grep 'PS1' ~/.* is empty, notwithstanding grep errors. That is to say, I'm not setting the PS1 variable in my home directory that I can see. I certainly haven't written code to do so.

I can change the prompt manually in one bash session:

PS1="\h:\W \u\$"

and that works for that session. But a new Terminal tab or window just gives me the (base) prefix once more.

I don't see anything in the preferences panes of the MacOS app Terminal, which is the app I use. Although… I did just launch an xterm and there the prompt is simply bash-3.2$ .

Can somebody help me figure out what is going on?

Best Answer

Looks like you installed Anaconda/python recently. Run

conda decactive 

to remove the (base) label (and deactivate conda of course).

PS: You may be using zsh instead of bash, so maybe you should look into .zshrc and .zprofile.