Reputation: 39
I am currently running Ubuntu 14.04 and this is my custom PS1:
PS1="\n\[\033[0;90m\]\t \[\033[01;32m\]\e[1m\u@\h\e[m:$ \[\033[0;33m\w\n\e[1m\[\033[1;31m\]➤\e[m "
I am getting this weird text wrapping effect, when I use the arrow up key to summon the last command I typed, it creates an overlap effect oO! Can anyone tell me what's wrong with it please?
Upvotes: 0
Views: 305
Reputation: 39
ok i had to do it on my own so here it is. so i did do this custom PS1 for like 5 years back or so, and that's why it's all fucked up, by the help of this well elaborated tutorial i fixed it so here it is:
PS1="\n\[\e[0;90m\]\t \[\e[01;32m\]\u@\h:$ \[\e[0;33m\]\w\n\[\e[1;31m\]➤ \[\e[0;37m\]"
Upvotes: 0
Reputation: 532303
You did not enclose all the non-printing characters in \[...\]
, and I think you want to leave things like \w
unenclosed.
PS1="\n\[\033[0;90m\]\t \[\033[01;32m\]\e[1m\u@\h\e[m:$ \[\033[0;33m\w\n\e[1m\[\033[1;31m\]➤\e[m "
^^^^^ ^^ ^^^^
Upvotes: 2