You are not logged in.
Hi I'm trying to customize my prompt but I have weird error/bug. My .bashrc looks like
alias ls='ls --color=auto'
alias grep='grep --color=auto'
#PS1='[\u@\h \W]\$ '
PS1="\e[1m[\e[0;34m\u@\h \e[1;37m\w]\e[0m\$ ";
complete -cf sudoAnd the bug is that when I type a long command the text is cut off and it starts to appear in the first column of the same line instead of the next line.
Just look at the screenshot where I typed aaaa... and then it is cut off and the aaa.... appear over my username and host name. Everything is fine if I use the default PS1 string.

Offline
This isn't really a bash bug. It has to do with the fact that resizing the terminal doesn't tell bash that it was resized, so it gets the size wrong. The fix is easy, but causes a very minor performance penalty (you'll never notice it):
shopt -s checkwinsizeThis will tell bash to re-check the window size every time it runs a command.
Offline
But I didn't resize anything. It's the default size
Offline
I've got the same problem, and you solution doesn't work
. The problem only appears, when the color of the prompt is set back to the default color (when the prompt is colored and the text you enter should not be colored).
Offline
does this happen with konsole? because konsole always had weird treating of lines to me. I ended up getting used to make the window as big as my screen, and used yakuake so that it is easy to access/hide it.
Offline
No, for me it happens in urxvt.
Offline
Wrap any terminal codes in \[ and \]. Otherwise, bash includes those characters when it calculates the size of your prompt. If my prompt-foo is strong, then this should be what your prompt string should look like:
PS1="\[\e[1m[\e[0;34m\]\u@\h \[\e[1;37m\]\w]\[\e[0m\]\$ "Offline
Yes I fixed just before your post.
THX.
Offline
Thanks, it works now. I was searching for this for a long time.
Last edited by Mo (2007-02-27 16:25:25)
Offline