You are not logged in.
Pages: 1
Hey,
my PS1 for root isn't working like i want it to.
It breaks lines and places previous commands in front of new ones, if i skim through the history with down or up arrows.
Any idea what's wrong with my .bashrc?
# Check for an interactive session
# .bashrc root
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
LS_COLORS='no=00:fi=00:rs=0:di=04:ex=00:';
export LS_COLORS
PS1='\t \W \e[31m# \e[0m'
PS2='\\ '
An example picture:
Thanks.
Last edited by demian (2010-02-28 16:53:19)
no place like /home
github
Offline
its not a flaw.
actually you need to tell that the color commands occupy no space - do it by using the escape character \e
check how to here: http://wiki.archlinux.org/index.php/Color_Bash_Prompt
for example, my $PS1 is the following:
\[\e[1;32m\]\A \[\e[0;01m\] \u\[\e[1;31m\]@\[\e[0;01m\]\h \[\e[1;31m\]\W\[\e[1;36m\] $\[\e[0;00m\]
edit:
just for you to notice: use the \[\e <color_here> \]
Last edited by quarkup (2010-02-28 15:54:07)
If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.
Offline
I have a similar problem even with a non-color PS1:
Last edited by anonymous_user (2010-02-28 16:06:06)
Offline
Offline
Ok thank you.
Offline
Offline
Pages: 1