3

I changed the PS1 for terminal to

export PS1="\033[0;33m\h:\W \u\$ \e[m"

Now, it doesn't type into new lines in case of a long sentence. Instead, it just overwrites on the existing written stuff in the same line.

Am I missing something ?

0

1 Answer 1

1

The correct syntax must be:

PS1="\[\033[0;33m\]\h:\W\u\$\[\033[m\]"

Or if you prefer to use \e instead of \033:

PS1="\[\e[0;33m\]\h:\W\u\$\[\e[m\]"

Your problem in missing \[ with the \e ASCII escape character (033)

enter image description here

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