You are not logged in.

#1 2010-09-18 17:58:10

szamot83
Member
Registered: 2010-04-24
Posts: 10

Need help with color bash prompt

Hello,
I'm trying to set bash prompt based on archbang. Configuration looks like this:
PS1="\e[01;31m┌─[\e[01;35m\u\e[01;31m]──[\e[00;37m${HOSTNAME%%.*}\e[01;32m]:\w$\e[01;31m\n\e[01;31m└──\e[01;36m>>\e[00m"

Problem is, that I can't get newline working. When I paste long command prompt not going to new line.

Could anybody help?

regards.

Offline

#2 2010-09-18 18:08:37

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Need help with color bash prompt

You're missing the \[ and \], follow this.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2010-09-18 18:17:08

szamot83
Member
Registered: 2010-04-24
Posts: 10

Re: Need help with color bash prompt

Arch wiki was first place where I have searched for solution - I'm respecting forum rules.
Thank ou for your answer. Could you tell me where I must insert \[ and \]?

Regards

Offline

#4 2010-09-18 18:28:34

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Need help with color bash prompt

That article has this,

\[         begin a sequence of non-printing characters, which could be used
             to embed a terminal control sequence into the prompt
\]         end a sequence of non-printing characters

Non-printing characters include color sequences. Essentially, any character that will not take a space in the prompt. See Basic prompts at the start of the article for an example of usage.

Last edited by fsckd (2010-09-18 18:29:02)


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

Board footer

Powered by FluxBB