Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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 ?
The correct syntax must be:
PS1="\[\033[0;33m\]\h:\W\u\$\[\033[m\]"
Or if you prefer to use \e instead of \033:
\e
\033
PS1="\[\e[0;33m\]\h:\W\u\$\[\e[m\]"
Your problem in missing \[ with the \e ASCII escape character (033)
\[
(033)