My PS1 variable cannot parsed correctly, it looks like this,
\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]
\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]
\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]mv .bashrc .bash_profile
\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]source .bash_profile
\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]
\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]ls
Applications Desktop Documents Downloads Google Drive Library Movies Music Pictures Public
\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]vim .bash_profile
\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]source .bash_profile
\[\e[;31m\][\u@\h \W]$ \[\e[m\]
\[\e[;31m\][\u@\h \W]$ \[\e[m\]
\[\e[;31m\][\u@\h \W]$ \[\e[m\]
\[\e[;31m\][\u@\h \W]$ \[\e[m\]
What is happened? Thanks.
PS1
on purpose? That very much looks like the result of an unfortunate accident. You should not havemv .bashrc .bash_profile
orsource .bash_profile
, etc.. In fact, you should normally choose just one of the lines\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]
or\[\e[;31m\][\u@\h \W]$ \[\e[m\]
. Personally, I preferPS1="\[\e[1;30m\]\D{%R}\[\e[1;34m\] \h:\w> \[\e[0m\]"
. To fix things just choose the prompt you will use and typePS1="yourprompthere"
on the command line. Then edit.bashrc
and findexport PS1="...."
and fix there. – Brey\[\e[1;30m\]\D{}\[\e[1;34m\] \h:\w> \[\e[0m\]export PS1="\[\e[1;30m\]\D{%R}\[\e[1;34m\] \h:\w> \[\e[0m\]" \[\e[1;30m\]\D{}\[\e[1;34m\] \h:\w> \[\e[0m\]
– Norwayexport PS1="\w"
does not work. My terminal cannot interpret it. – NorwayPS1
to zsh? I have no idea how zsh interprets prompt strings, though. – Faso[\u@\h:\w]\$ export PS1='\[\e[31m\]\u@\h:\w\[\e[0m\] ' \[\e[31m\]\u@\h:\w\[\e[0m\]
which is an example in this link. It still does not work. This is a new mac. I do not whether I should install something or activate PS1. – Norwayzsh
, then you will need something likePS1="%F{243}%T %F{27}%m:%~>%f "
Post the output ofecho $SHELL
– Breyzsh
. I tried for a while, but always came back to bash. – Brey