0

I want my command prompt to be like this:

xyz$

but in green. So I put into my bashrc some code I found yet it does not work.

PS1="xyz\[\032[COLOR]m\]$"

This changes the command prompt to

xyz�[COLOR]m$

How can I get this to work?

I found this works but unfortunately now all the text is green - even the text after the prompt! Getting closer. I want the text that follows the prompt to look like it always did.

PS1="\[\033[0;32m\]xyz$ "
1

1 Answer 1

0

You should add reset code after changing color. \033[00m resets your prompt color.

In addition, your PS1 makes your prompt []xyz$ . If you want xyz$ without [], please set as below:

PS1="\033[0;32mxyz\033[00m$ "

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .