You are not logged in.
Hello I have my ps1 set to
# Prompt
BGREEN='\[\033[1;32m\]'
GREEN='\[\033[0;32m\]'
BRED='\[\033[1;31m\]'
RED='\[\033[0;31m\]'
BBLUE='\[\033[1;34m\]'
BLUE='\[\033[0;34m\]'
NORMAL='\[\033[00m\]'
if [ "$TERM" = "linux" ]; then
PS1="${NORMAL}[\u${BLUE}@\h ${BGREEN}\W${NORMAL}]\$ "
else
PS1="\e]2;\u@\H:\w\a${NORMAL}[\u${BLUE}@\h ${BGREEN}\W${NORMAL}]$ "
fi
However when my prompt displays [pyther@tux world.pyther.net]$ (color) I can only type 3 characters and then it wraps. Please see the screenshot...
Using a regular prompt (source /etc/profile) works like a charm. Any help would be great!
Last edited by pyther (2008-10-15 03:06:48)
Offline
Try escaping the last $ in your else..fi block.
Last edited by byte (2008-10-13 23:50:07)
1000
Offline
Didn't I just answer this question in another thread? You need to escape the colors codes with \[ \] so that bash knows that they are non-printing characters, otherwise they will be counted in the prompt length.
[git] | [AURpkgs] | [arch-games]
Offline
Try changing the single quotes to double quotes in your color variable assignments.
[git] | [AURpkgs] | [arch-games]
Offline
# Prompt
PS1="[\u\[\033[0;34m\]@\h \[\033[1;32m\]\W\[\033[00m\]]\$ "
# X Terminal titles
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
*)
;;
esac
The ps1 prompt I just put the color codes in. o_0
I found the second part in this thread and it worked wonders! http://bbs.archlinux.org/viewtopic.php?id=48358
Thanks for your help!
Last edited by pyther (2008-10-15 03:05:12)
Offline
Didn't I just answer this question in another thread? You need to escape the colors codes with \[ \] so that bash knows that they are non-printing characters, otherwise they will be counted in the prompt length.
You're probably confusing this thread with mine a few days ago about using colors in PS1 in bash. ( http://bbs.archlinux.org/viewtopic.php? … 03#p432903 )
This issue is very similar indeed
Last edited by Dieter@be (2008-10-15 19:41:56)
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline