You are not logged in.
When I am working with filenames that are particularly long and the line has to wrap, it wraps over the /current/ line instead of the one after, so I get a garbled display. Is there anything I can do to fix it? I was told that it may have something to do with my bash prompt:
\[\e[1;37m\]\u\[\e[0m\]@\e[32m\]\h\e[0m\]: \e[35m\]\w\[\e[0m\] $
Outputs: xelados@mini-spork: ~ $
Is something malformed?
Last edited by xelados (2009-11-24 00:04:22)
Offline
When I am working with filenames that are particularly long and the line has to wrap, it wraps over the /current/ line instead of the one after, so I get a garbled display. Is there anything I can do to fix it? I was told that it may have something to do with my bash prompt:
\[\e[1;37m\]\u\[\e[0m\]@\e[32m\]\h\e[0m\]: \e[35m\]\w\[\e[0m\] $
Is something malformed?
There seems to be 2 missing escapes ("\["):
\[\e[1;37m\] \u \[\e[0m\] @ \e[32m\] \h\e[0m\] : \e[35m\] \w \[\e[0m\] $
\[\e[1;37m\] \u \[\e[0m\] @ \[\e[32m\] \h\e[0m\] : \[\e[35m\] \w \[\e[0m\] $
Even with all of the escapes I still have problems with wrapping quite often with urxvt. When that happens, I just resize the screen and it seems to update the internal number of columns.
*edit*
Make that 3:
\[\e[1;37m\] \u \[\e[0m\] @ \e[32m\] \h \e[0m\] : \e[35m\] \w \[\e[0m\] $
\[\e[1;37m\] \u \[\e[0m\] @ \[\e[32m\] \h \[\e[0m\] : \[\e[35m\] \w \[\e[0m\] $
Last edited by Xyne (2009-11-24 01:24:03)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
\[\e[1;37m\]\u\[\e[0m\]@\e[32m\]\h\e[0m\]: \e[35m\]\w\[\e[0m\] $
the solution:
\[\e[1;37m\]\u\[\e[0m\]@\[\e[32m\]\h\[\e[0m\]: \[\e[35m\]\w\[\e[0m\] $
It seems like I needed an escape just after \h, as well. Thanks for pointing that out, though; it works now!
Offline
Ooops, missed that one... yeah, they're hard to catch.
I found it was easier to use variables instead:
COLOR_1="\[\e[1;37m\]"
COLOR_2="\[\e[0;37m\]"
COLOR_3="\[\e[1;34m\]"
COLOR_4="\[\e[1;30m\]"
PS1="${COLOR_3}[${COLOR_2}\u...
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
It seems to only selectively work. I wonder what's causing it. Perhaps a bash-fu master can help?
Offline